I quickly implemented a fuzzy search using SQL LIKE clause as follows
Podcast.where("title LIKE ?", "%#{params[:q]}%")
This isn't treated the same by all SQl implementations (i.e sqlite searches case insensitive, posgresql case sensitive). It's generally bad to use raw SQL instead of letting ActiveRecord, or a library handle it.
I quickly implemented a fuzzy search using SQL LIKE clause as follows
This isn't treated the same by all SQl implementations (i.e sqlite searches case insensitive, posgresql case sensitive). It's generally bad to use raw SQL instead of letting ActiveRecord, or a library handle it.