As we know that, currently there are plenty of content based sites and we usually see a search box within that, to search any topic that is available in that site. So today we will be discussing on how to create a basic search form in rails.
For creating a search form, basically you need a input box and submit button. The request for search should be get as it allows user to bookmark a specific search for future visit. The search form in rails will look something like this:
<%= form_tag("/search-in-site", method: "get") do %>
<%= label_tag(:q, "Search:") %>
<%= text_field_tag(:q) %>
<%= submit_tag("Search") %>
<% end %>