我已经在谷歌上搜索过这个问题,但没有运气。我已经在其他地方实现了它,并且知道它是有效的,但是我不能理解这个特殊情况下的问题是什么
这是页面的控制器
class Companies::PropertiesController < Companies::BaseController
def index
@search = Property.ransack(params[:q])
@properties = @search.result
end
end这就是我要搜索的html.erb
<%= search_form_for @search do |f| %>
<div class="field">
<%= f.label :property_address_cont %>
<%= f.search_field :property_address_cont %>
</div>
<div class="actions"> <%= f.submit "search" %></div>
<%end%>页面的路由是properties/ broker,broker是html.erb文件的名称
发布于 2015-09-01 04:44:57
在您的控制器中尝试以下内容:
def index
@search = Property.search(params[:q])
@properties = @search.result
end发布于 2016-07-14 03:51:50
这与模型名有关,因为我的模型名为PropertyPool
注意:该错误仅在生产环境中发生
https://stackoverflow.com/questions/31619844
复制相似问题