表单定位到结果页面:
<%= form_tag results_interventos_path do %>
From: <%= date_select :intervento, :from, { order: [:day, :month, :year], default: Date.today-31, start_year: Time.now.year-1, end_year: Time.now.year, datetime_separator: " " } %>
To: <%= date_select :intervento, :to, { order: [:day, :month, :year], default: Date.today-30, start_year: Time.now.year-1, end_year: Time.now.year, datetime_separator: " " } %>
<%= collection_select(:intervento, :invoicestate_id, Invoicestate.all, :id, :nome, prompt: "tutti") %>
结果将路由到目前定义为:
的分页(带will_paginate
)页面
post :results
目标:维护网址中的搜索参数,以便可以使用:back
符号
答案 0 :(得分:0)
通过正确的路由,解决了这个问题:
get :results
表格也应该指出正确的方法
<%= form_tag results_interventos_path, method: :get do %>
否则会尝试发帖。