ransack search form in header partial: No Ransack::Search object was provided to search_form_for

前端 未结 3 763
长情又很酷
长情又很酷 2021-02-04 14:30

First of all, I\'m new to RoR, so the answer may be obvious, in which case I apologize. I\'ve looked around and haven\'t found anything that helps.

I\'m trying to have

3条回答
  •  余生分开走
    2021-02-04 15:00

    Looks like this is not possible. This is a comment from Ernie the gem author.

    You'd have to handle the Ransack-required stuff in a before_filter or (ick) in the view partial itself. If you're putting a search field on every single part of the site, I'd recommend you strongly consider whether ransack is the right tool for the job, as well. You might want some sort of inverted index search setup like sphinx, solr, etc.

    https://github.com/ernie/ransack/issues/3

提交回复
热议问题