1

Well when we are implementing simple search its something like (searching for a song):

Model:

def self.search(query5)
         where("name LIKE ? ","%#{query5.downcase}%")
     end

but when the query is something like James TW when you love someone and the name of the song is when you love some James TW it doesnt return anything. So what do I do about that hat the correct logic for that?

J.Danely
  • 37
  • 5

2 Answers2

0

It's not currently being maintained, but I've used the Ransack gem to great success. It removes much of this complexity.

chad_
  • 3,749
  • 2
  • 22
  • 22
0

SQL LIKE expression will not work in your case. You should think of using a full text search engine.

Community
  • 1
  • 1