title: Rails 4: Disable submit button after click
body: <p>I have a <code>form_tag(foo_path(@foo), remote: true, id: 'foo-form'</code> form and a submit button <code>submit_tag ("Submit", :id =&gt; "foo-submit")</code> </p>
  
  <p>I'd like to disable the submit button after it has been clicked. Obviously, I cannot use something like <code>onlick="jQuery(this).prop('disabled', true);"</code> because it would break the remote functionality. I'm aware of the <code>:disable_with</code> data attribute for the submit_tag but it doesn't seem to work for me. It does generate the right form code but it has no effect. I'm not sure why it doesn't work but it might be due to the fact that I use prototype  (legacy reasons) and jquery at the same time. Though, I only load <code>ujs</code> for jquery and not for prototype. However, all other <code>query_ujs</code> features work very well.    </p>
  
  <p>Is there another way to disable the submit button?</p>