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
Post a Comment