RailsCasts Pro episodes are now free!

Learn more or hide this

Jao Zafra's Profile

GitHub User: jaozafra

Comments by Jao Zafra

Avatar

Hey Jake,

Since we're doing it server-side, i think you should handle the case-insensitiveness on your code.

Looking at the example, we have a query

ruby
products = products.where("name like :search or category like :search", search: "%#{params[:sSearch]}%")

What i did to fix this is use "ilike" instead of "like".
This way, we're doing a case insensitive like.

Hope this helps.