Tag: kaminari

不需要的表单参数将附加到分页链接

我有一个页面,用于通过使用提供的表单提交数据来搜索列表。 表单参数通过ajax(post request)提交,在搜索表中创建一个新记录,然后通过此记录的show动作显示列表(动态地,在表单提交的同一页面上)。 结果有kaminari提供的分页链接,如下所示: {:controller => ‘searches’, # I have to specify the id because my searches are stored in the database :action => ‘show’, :id => search.id}, :remote => true %> 请注意,分页链接会动态包含在页面中。 因此,当我进行新搜索并获取新列表时,服务器会重新呈现分页链接。 这是我在搜索控制器中的show动作 def show @search = Search.includes(:rate).find(params[:id]) @matches = @search.matches.order(sort_column + ” ” + sort_direction).page(params[:page]) respond_to do |format| format.html format.xml { render […]