Ruby on rails 没有提供搜索对象来搜索表单以查找错误
我用谷歌搜索了这个问题,但运气不好。我已经在其他人身上实现了这一点,并且知道它是有效的,但我无法理解这个特定案例的问题是什么 这是页面的控制器Ruby on rails 没有提供搜索对象来搜索表单以查找错误,ruby-on-rails,ruby-on-rails-4,model-view-controller,ransack,Ruby On Rails,Ruby On Rails 4,Model View Controller,Ransack,我用谷歌搜索了这个问题,但运气不好。我已经在其他人身上实现了这一点,并且知道它是有效的,但我无法理解这个特定案例的问题是什么 这是页面的控制器 class Companies::PropertiesController < Companies::BaseController def index @search = Property.ransack(params[:q]) @properties = @search.result end end class Comp
class Companies::PropertiesController < Companies::BaseController
def index
@search = Property.ransack(params[:q])
@properties = @search.result
end
end
class Companys::PropertiesController
这是我试图推动搜索的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文件的名称在控制器中尝试以下操作:
def index
@search = Property.search(params[:q])
@properties = @search.result
end
这与模型名有关,我的模型名为PropertyPool
注意:该错误仅发生在生产中如果您不提供任何解决方案,该错误如何回答问题或帮助任何人?