I have this piece of code for a search query in my ruby on rails application. It works locally on the rails local server but not when I deploy on Heroku. Here's the line of code for that query:
@courses = Course.where("name LIKE? ","%#{params[:search][:course].downcase}%").all
A little bit of context: Course is my database model and it has a field called "name", here I am searching for all the courses with names containing certain words as specified from the user, that query word is passed in via the form params.
UPDATE: Thank you Danilo and Brad! Solved with putting a space in between LIKE and ? and used ILIKE instead of LIKE.
@courses = Course.where("name ILIKE ? ","%#{params[:search][:course].downcase}%")