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

前端 未结 2 523
余生分开走
余生分开走 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: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.

提交回复
热议问题