A
A
Alexander Isaev2016-03-03 23:26:36
Ruby on Rails
Alexander Isaev, 2016-03-03 23:26:36

How to search in multiple models?

Hello everyone) I am implementing a search on the site using the searchkick gem. Everything works, but only for one model. How to search across multiple models? Thanks in advance.
______________________
<%= form_tag products_path, method: :get, class: "navbar-form navbar-right", role: "query" do %>
<%= text_field_tag ​​:query, params[:query], class: "form-control ", id: "product_search", autocomplete: "off" %>
<%= submit_tag "Search", name: nil, class: "btn btn-default" %>
<% end %>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
TyzhSysAdmin, 2016-03-04
@IsaevAlex

At least sometimes you go into the turnips of the gems you want and use the search there :)
https://github.com/ankane/searchkick/issues/257
There is the same in the docks.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question