Reputation: 911
I am trying to use joins in rails to retrieve some info base on a search field but I cannot seem to find the good syntax, I have two table savings and product and saving are saving for a product. What I want is to find a saving based on the name of the product I found that this work : Saving.all(:joins => :product, :conditions => { :products => { :title => 'Title Name' } }) It retrieve the saving corresponding to the product named Title Name.
Now how can I change that to find the savings where product title contains params[:title] ?
Thanks,
Upvotes: 1
Views: 2463