Is there any method or action in Rails 3 for case insensitive search ?
this is the code i use for searching and the database is sqlite3.
If i search for clint using this code it doesn't return any value but if searched for Clint it shows up with the results.
Thank You.
Katrina Owen
Sheriff
Joined: Nov 03, 2006
Posts: 1300
posted
0
If you want all your searches on that column to be case insensitive (and because you are using sqlite3) you can specify at the database level.
If you just want that particular query to be case insensitive, you're going to need to jump through a couple more hoops, I think (I rarely use sqlite3, so there may be other options that I'm not aware of).
That will still probably fail for names with accents or funky Scandinavian characters, though.
On an unrelated note, I suggest that you add a method to your ClientWorkouts model called or some such thing that you call from your controller :)