Rails controller match one var to another var -


i have table has alot of data inside it

i'm wanting this. grab inside column matches else inside column in table.

so @car = cardata.find_by(@carmake)

so, @carmake volvo, typed in separate form , stored in table.

in table cardata there massive list (about 40k records) different cars ranging ford renault volvo.

the question is. @car display records have word volvo inside?? or wrong way of doing this? or need label column?

sam

to of them:

@cars = cardata.where(carmake: @carmake).all 

to first:

@car = cardata.where(carmake: @carmake).first     

Comments

Popular posts from this blog

Capture and play voice with Asterisk ARI -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -