Module: Bh::Helpers::Confirmations
- Included in:
- Bh::Helpers
- Defined in:
- lib/bh/helpers/confirmations.rb
Overview
The button that asks before it acts.
Instance Method Summary collapse
-
#confirm_button_to(words, path, confirm:, **options) ⇒ String
A button whose form is sent only where the question it carries is answered yes.
Instance Method Details
#confirm_button_to(words, path, confirm:, **options) ⇒ String
A button whose form is sent only where the question it carries is answered yes. The bundle draws that question as a dialog. Every option is the button's, and the question rides on the form, which is what Turbo asks before submitting either.
13 14 15 16 17 |
# File 'lib/bh/helpers/confirmations.rb', line 13 def (words, path, confirm:, **) form = { data: { turbo_confirm: confirm } }.deep_merge .fetch(:form, {}) words, path, **.except(:form), form: form end |