Jackson Henley
Jackson Henley

Reputation: 1531

A way to prevent user from posting twice by accident?

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?

Upvotes: 2

Views: 453

Answers (1)

Dave Isaacs
Dave Isaacs

Reputation: 4539

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.

Upvotes: 3

Related Questions