How do i differentiate different submits tags / buttons on one form. Say
I want to create an edit form and I want to provide two buttons; one to
save and one to cancel. I would have:
<%= submit_tag ‘Ok’ %>
<%= submit_tag ‘Cancel’ %>
How do I know which button get pressed by the user?
One more thing, how to specify the default selection in a select tag
Often links are used for cancel. It’s simpler and links can be nested
If you want to use buttons for non-remote forms, you just need to give
different name/id so your controller can distinguish them. If you want
use buttons in remote_forms, you need to hack something with hidden
because prototype serializes only one submit button.