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?
Check the following in your raw html:
You can read more on https://github.com/rails/jquery-ujs.
<%= button_tag 'submit', data: { disable_with: "Processing..." }, class: 'btn btn-info btn-block' %>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With