Skip to content

disable registration submit button after 1 click #259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

codebender
Copy link
Contributor

Bounty 446 - BUG: PG::UniqueViolation: ERROR: duplicate key value violates unique constraint "index_users_on_username" DETAIL: Key (username)=(XXXXXXX) already exists.

I have seen this sort of problem in the past on other projects. Adding data: { disable_with: "Submitted" } to a submit_tag or link_to disables the button after the first click. I smoke tested locally and it works as advertised. For more info: http://www.railsonmaui.com/blog/2014/02/23/simple-form-and-disable-processing-by-default/

BTW, our validates_uniqueness_of :username does work, but double clicks create a race condition. 🐎 🚗💨

just3ws added a commit that referenced this pull request Dec 11, 2014
…ation

disable registration submit button after 1 click
@just3ws just3ws merged commit 894861d into coderwall:master Dec 11, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants