Re: [Rails] search not working right

2015-12-07 Thread Colin Law
On 7 December 2015 at 13:55, fugee ohu wrote: > when the search gets submitted it only returns results for records that had > the searched value in publicists > > from my model: > def self.search(search) > where("headline LIKE ?", "%#{search}%") > where("storyline LIKE

[Rails] search not working right

2015-12-07 Thread fugee ohu
when the search gets submitted it only returns results for records that had the searched value in publicists from my model: def self.search(search) where("headline LIKE ?", "%#{search}%") where("storyline LIKE ?", "%#{search}%") where("publicist LIKE ?", "%#{search}%") end from my

Re: [Rails] search not working right

2015-12-07 Thread fugee ohu
Thanks Colin, the person who posted that code sure had me fooled, i could have done better myself without adding code to the model It looked like an advanced technique, who would have guessed it was so wrong On Monday, December 7, 2015 at 9:17:13 AM UTC-5, Colin Law wrote: > > On 7 December

Re: [Rails] search not working right

2015-12-07 Thread Colin Law
On 7 December 2015 at 16:15, fugee ohu wrote: > Thanks Colin, the person who posted that code sure had me fooled, i could > have done better myself without adding code to the model It looked like an > advanced technique, who would have guessed it was so wrong Where did you

Re: [Rails] search not working right

2015-12-07 Thread James Jelinek (shakycode)
Also in the previous code, you can do ILIKE instead of like to get rid case sensitivity. Just a FYI :) > On Dec 7, 2015, at 10:25 AM, Colin Law wrote: > > On 7 December 2015 at 16:15, fugee ohu > wrote: >> Thanks Colin, the

Re: [Rails] search not working right

2015-12-07 Thread fugee ohu
>> Where did you see it posted? Have you still got the link? >> Colin http://www.korenlc.com/creating-a-simple-search-in-rails-4/ -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving

Re: [Rails] search not working right

2015-12-07 Thread Colin Law
On 7 December 2015 at 17:34, fugee ohu wrote: >>> Where did you see it posted? Have you still got the link? >>> Colin > > > http://www.korenlc.com/creating-a-simple-search-in-rails-4/ If you read the comments you will see that others have pointed out the error, though why it