Currently working with the Searchkick gem and trying to figure out how to search with multiple queries at the same time.
I want the search queries to be pre-defined using a select (drop down).
My controller looks like this currently:
def index
@application = Application.search(params[:query])
end
and my view:
<%= form_tag search_company_path, method: :get do %>
<p>
<%= label_tag :query, "Type" %>
<%= select_tag :query, options_for_select(['Test 1','Test 2','Test 3', 'Test 4', 'Test 5']) %>
<%= label_tag :query, "On location?" %>
<%= select_tag :query, options_for_select(['Yes', 'No', 'Either']) %>
<%= submit_tag "Search", name: nil %>
</p>
<% end %>
this works to run two select_tags with the same :query, but I'm guessing that ain't very nice coding. Nor can I create a label_tag for the latter.
Also if I perform a successful search it resets the select_tag to the 1st (test 1 and Yes), how do I fix this as-well?