Rails data-disable-with re-enabling button

前端 未结 4 1032
情深已故
情深已故 2021-01-31 03:32

I have a Rails Devise form that has javascript validation. When the user presses submit, the validation works and the user is refocused on the form where they need to be.

4条回答
  •  花落未央
    2021-01-31 04:14

    This behaviour was changed in Rails 5, now it's disabling submits by default.

    Rather than accepted answer, I would suggest to use the following configuration:

    config.action_view.automatically_disable_submit_tag = false
    

    or, to do it ad-hoc for specific buttons, add this to the submit button

    data: { disable_with: false }
    

提交回复
热议问题