how can I make this query not Case sensitive?
@courses = Course.where('name LIKE ?', "%#{params[:name]}%")
Advertisement
Answer
When you use a Postgres database then you might want to consider ILIKE
which is the case insensitive version of LIKE
:
@courses = Course.where('name ILIKE ?', "%#{params[:name]}%")