I'm a Rails noob, and am looking for assistance in clearing the results of a search.
I've built a sample application which lists cafes, and have implemented searching using elasticsearch and searchkick. The search function appends parameters to the URL as in http://localhost:3000/cafes?search=sydney&commit=Search and is working correctly.
Now I'd like to add a button to clear the search results:
The Clear button's link is to the cafes_path
(http://localhost:3000/cafes), so it basically reloads the page without the search parameters:
= form_tag cafes_path, :method => :get do
= text_field_tag :search
= submit_tag value = "Search"
= link_to cafes_path
Please let me know if you need to see more of the model or controller code to make sense of the question.