Possible Duplicate:
Ruby on Rails: How to have multiple submit buttons going to different methods (maybe with with_action?)
In a form I have some submit_tags and on server side I have to detect which one was clicked. This is that I've tried, not working: on server side I only get an action name in params:
<%= form_tag controller_action_path(:id => @project.id), :method => :post do %>
<% if @project_is_synced %>
<%= submit_tag 'Update synchronization', :name => 'update' %>
<%= submit_tag 'Stop synchronization', :name => 'stop' %>
<% else %>
<%= submit_tag 'Start synchronization', :name => 'start' %>
<% end %>
<% end %>
I have only params[:action]
with a current action name which is always the same