aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorTeddy Wing2018-01-09 17:48:23 +0100
committerTeddy Wing2018-01-09 17:48:23 +0100
commitf9bc7a661c2fb88aef1662bd60d8d6d8a3cff443 (patch)
tree35d0a493846c833e8e44242bf8f811af19d7e0ae /app
parent7e152ed43030c939a719be5949b71a5179c3dcd7 (diff)
downloadchouette-core-f9bc7a661c2fb88aef1662bd60d8d6d8a3cff443.tar.bz2
Referentials#new: Disable submit button on submit
To prevent double/duplicate form submissions, disable the submit button after it's clicked. Eventually we'll want to do this for all SimpleForms in the application. Here's a solution for doing that: http://www.railsonmaui.com/blog/2014/02/23/simple-form-and-disable-processing-by-default/ Refs #5524
Diffstat (limited to 'app')
-rw-r--r--app/views/referentials/_form.html.slim6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/views/referentials/_form.html.slim b/app/views/referentials/_form.html.slim
index 1611ee6dd..9927f05bd 100644
--- a/app/views/referentials/_form.html.slim
+++ b/app/views/referentials/_form.html.slim
@@ -51,4 +51,8 @@
.hidden = form.input :workbench_id, as: :hidden
- = form.button :submit, t('actions.submit'), class: 'btn btn-default formSubmitr', form: 'referential_form'
+ = form.button :submit,
+ t('actions.submit'),
+ class: 'btn btn-default formSubmitr',
+ data: { disable_with: t('actions.processing') },
+ form: 'referential_form'