ruby on rails 3 - ActiveRecord where method -


i have model sample attribute car

car csv different car names

x.car = "bmw,ferrari,audi" sample.where(:car => "bmw") 

returns [].

how can use operator in sql returns x

use condition in method (works prepared queries).

sample.where("car ?", "bmw%") 

more examples can found in rails guide.


Comments

Popular posts from this blog

JQuery Autocomplete without using label, value, id -

c++ - Accessing inactive union member and undefined behavior? -

JAVA - what is the difference between void and boolean methods? -