Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 没有提供搜索对象来搜索表单以查找错误_Ruby On Rails_Ruby On Rails 4_Model View Controller_Ransack - Fatal编程技术网

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


注意:该错误仅发生在生产中

如果您不提供任何解决方案,该错误如何回答问题或帮助任何人?