1

我的嵌套资源适用于 form_for 更新,但我需要设置一些切换来更改状态字段。所以我正在使用link_to,并访问url helper。

   link_to "toggle", edit_project_expense_path(@project[:id],expense_item[:id])

路线.rb

 resources :projects do
    resources :expenses
  end

  match '/submit_expense/:id' => 'expenses#submit_expense', :as => 'submit_expense'

耙路线

edit_project_expense GET    /projects/:project_id/expenses/:id/edit(.:format) expenses#edit

我的问题是:我怎样才能发送:approval_status =“1”,我的link_to?

4

1 回答 1

3
  link_to "toggle", edit_project_expense_path(@project[:id],expense_item[:id], approval_status: 1)
于 2012-11-07T19:44:37.663 回答