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