2

What are some of the ways to prevent a users from clicking a button twice and inadvertently posting twice? Are there any methods specific to rails?

Jackson Henley
  • 1,531
  • 2
  • 15
  • 27
  • 1
    http://stackoverflow.com/questions/3160204/in-rails-controllers-how-to-prevent-double-submit-when-user-double-clic-submit this might help you – Anthony Alberto Aug 09 '12 at 00:59

1 Answers1

3

The button_tag helper includes an option, :disable_with. Using this option will disable the button (using unobtrusive JavaScript) when the form is submitted, preventing additional clicks.

Dave Isaacs
  • 4,499
  • 6
  • 31
  • 44