我有我的表單標籤,我的表單中也有兩個按鈕。如何在點擊提交按鈕時在我的表單中調用不同的操作。如何在兩個提交標籤中提及表單中的不同動作?
這裏是我的代碼:
<%= form_for :attachment_metadata, :url=>{:action=>'delete_files'}, :html=>{:onsubmit=> "return confirm('Are you sure, you want to delete selected files?');",:multipart => true} do |f| %>
<table>
..........Some stuff here..........
</table>
<%= submit_tag 'Reprocess', :class =>'button' %>
<%= submit_tag 'Remove', :class =>'button' %>
<% end %>
論「再加工」我想打電話給不同的動作,但在相同的形式點擊。
我怎樣才能做到這一點?
請幫
在此先感謝
看到http://stackoverflow.com/questions/13987512/how-can-i-get-f-submits-name-parameter-in-controller/13988021#13988021 – shweta