MetaSearch “undefined method `model_name' for NilClass:Class” for global bar search

前端 未结 2 524
余生分开走
余生分开走 2020-12-17 04:46

I\'m using fantastic MetaSearch by Ernie, but I\'m having an annoying issue.

In my application.html.erb I have an search field, just like this one on top of StackOve

相关标签:
2条回答
  • 2020-12-17 05:32

    You would get this error if @search is set to nil. Ensure that this is not the case.

    0 讨论(0)
  • 2020-12-17 05:42

    Try this syntax:

    <%= form_for(:object) do |obj| %>
    

    In my case I was using the view to collect nested attributes from user inputs but this syntax also gets around this error message in other contexts.

    0 讨论(0)
提交回复
热议问题