Ruby on rails 以简单形式传递额外的参数
我需要向我的控制器传递一个额外的参数,因为我对许多编辑表单使用相同的更新操作(想知道使用了哪个表单)Ruby on rails 以简单形式传递额外的参数,ruby-on-rails,ruby,simple-form,Ruby On Rails,Ruby,Simple Form,我需要向我的控制器传递一个额外的参数,因为我对许多编辑表单使用相同的更新操作(想知道使用了哪个表单) 尝试使用: <%= simple_form_for @order, url: order_path(@order), method: :put, remote: true do |f| %> <%= f.input :status, collection: @order.statuses %> <% #pass random hid
尝试使用:
<%= simple_form_for @order,
url: order_path(@order),
method: :put,
remote: true do |f| %>
<%= f.input :status,
collection: @order.statuses %>
<% #pass random hidden param here! %>
<%= f.button :submit %>
<% end %>
<%= simple_form_for @order,
url: order_path(@order),
method: :put,
remote: true do |f| %>
<%= f.input :status, collection: @order.statuses %>
<%= hidden_field_tag 'name', 'value' %>
<%= f.button :submit %>
<% end %>