I have the following search form, which should also perform filtering:
<%= form_tag search_index_path, method: :get, id: 'search_form' do %> <%= text_field_tag :search, params[:search] %> <%= check_box_tag 'filter param', 'yes', true %> <%= submit_tag "Search", name: nil, class: 'btn' %> <% end %>
What I'm trying to do now is to wrap the filtering parameters in a nested hash so that I have something like the following in the parameters: {"utf8"=>"β", "search"=>"term", "action"=>"index", "controller"=>"search", "filter" => {"field" => "value"}} . Please note that the filter options are nested.
I could not find a way to do this using standard rails creating helpers. Is there any way to do this?
source share