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

大憨熊 提交于 2019-11-29 04:56:47

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

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!