【发布时间】:2016-04-07 17:26:44
【问题描述】:
当我进行搜索时,我的 url 结果是:
/refinanciamentos/index?utf8=✓&pesquisa_func_cpf=**111.111.111-11**&pesquisa_func_matricula=&commit=Pesquisar
然后显示所有搜索结果,我点击按钮:
<%= link_to 'Reserva', refinanciamentos_reserva_refinanciamento_path, :class => 'btn btn-primary' %>
这个按钮转到其他视图和其他方法。 如何在同一控制器中为其他方法传递搜索参数(pesquisa_func_cpf=111.111.111-11)? 搜索的方法是索引,我需要传递方法reserva_refinanciamento的参数,如何制作?我对此一无所知=/
---------- UDPDATE: 这是我的控制器
def index
if params[:pesquisa_func_cpf].present?
@funcionarios = Funcionario.pesquisa_cpf(params[:pesquisa_func_cpf]).all
@autorizacoes = Autorizacao.pesquisa_func_cpf(params[:pesquisa_func_cpf]).all
(...)
def reserva_refinanciamento
# nothing here
【问题讨论】:
标签: ruby-on-rails ruby ruby-on-rails-4 rails-4-2-1