I have a Ruby on Rails app, and I am trying to perform a search through a model. From the front end, I am passing the query string.
In courses_controller.rb I have the following code:
...
Course.where("courses.name ILIKE ?", "%#{params[:search]}%")
...
If params[:search] is equal to something like "marketing", it will retrieve the item with name "marketing course". But if params[:search] is equal to "marketing course", nothing is retrieved.
How can I perform search with multiple words?
Thanks a lot.