I am using Devise gem which provides a 'Forgot your password' form and 'Resend confirmation' form. Both consist of an input field for e-mail and a submit button. I would like to combine these two forms into one, so that there's only one e-mail field and two submit buttons. Depending on whether 'Reset password' or 'Resend confirmation' button is pressed the form will be submitted to the associated action.
Update: Basically, I would like to have these two forms:
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email, :autofocus => true %></div>
<div><%= f.submit "Send me reset password instructions" %></div>
<% end %>
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email, :autofocus => true %></div>
<div><%= f.submit "Resend confirmation instructions" %></div>
<% end %>
to share the f.label :email input, but post to action for which the button was pressed. For instance, the :email value will be submitted to confirmation_path when I press "Resend confirmation instructions" button, and when I press f.submit "Send me reset password instructions" the :email value will be posted to password_path(resource_name).