Reputation: 135
My form looks like this:
<%= form_for(@foobar) do |f| %>
<%= render 'shared/error_messages', object: f.object %>
~~~form stuff~~~
<%= submit_tag "submit", data => { disable_with: "Processing" }, :class => "btn btn-info btn-block" %>
<% end %>
I'm running rails 3.2.11. I have the jquery-rails gem installed and all my other jQuery stuff works. Why am I still able to hit the "submit" button multiple times while it's still loading? How do I disable the button?
Upvotes: 4
Views: 6034
Reputation: 341
<%= button_tag 'submit', data: { disable_with: "Processing..." }, class: 'btn btn-info btn-block' %>
Upvotes: 3
Reputation: 11716
Check the following in your raw html:
You can read more on https://github.com/rails/jquery-ujs.
Upvotes: 6