How to add condition "LIKE ? %something%" to the product title to this join
Product.find(:all,
:conditions => { :companies =>开发者_开发技巧; { :malls => { :id => 1},:products => {:title => "nexus one"} }},
:joins => [:company => :mall])
I found the solution, I think I have to take break,
Product.find(:all,:conditions => ['title LIKE ? and mall_id = ?', "%#{search}%",mall_id],
:joins => [:company => :mall])
精彩评论