I am using Devise in my web application and was wondering how to use a different button than the default one to submit information. I am attempting to embed it in a twitter boot strap modal, and use a button in the footer of the modal to submit the info, rather than the standard signup button. Here’s what I have for code right now:
<div class="modal-body">
<h4>...</h4>
<p>...</p></b>
<p>...</p>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div>
<%= f.label :email %>
<%= f.email_field :email %>
</div>
<div>
<%= f.label :password %>
<%= f.password_field :password %>
</div>
<div>
<%= f.label :password_confirmation %>
<%= f.password_field :password_confirmation %>
</div>
<div>
<%= f.submit "Sign up" %>
</div>
<% end %>
</div>
<div class="modal-footer">
<a href="#" class="btn" data-dismiss="modal">Close</a>
<a href="#" class="btn btn-primary">Sign up</a>
</div>
</div>
In essence, I am trying to make the button in this line
<a href="#" class="btn btn-primary">Sign up</a>
do what the button in this line does:
<div><%= f.submit "Sign up" %></div>
Anybody out there have any experience with this?
you can just extend the form… say to cover the modal body and the footer too, and replace the link
do something like
Because this seems a little too obvious, I’m not really sure I understood your question very well. If that’s the case, let me know