Module: SweetAlertConfirm::ViewHelpers
- Defined in:
- lib/sweet-alert-confirm/view_helpers.rb
Instance Method Summary collapse
- #button_tag(*args, &block) ⇒ Object
- #link_to(*args, &block) ⇒ Object
- #submit_tag(value = 'Save changes', options = {}) ⇒ Object
Instance Method Details
#button_tag(*args, &block) ⇒ Object
18 19 20 21 22 23 24 25 26 |
# File 'lib/sweet-alert-confirm/view_helpers.rb', line 18 def (*args, &block) = args[block_given? ? 0 : 1] || {} if () ['data-sweet-alert-confirm'] = .delete(:confirm) || [:data].delete(:confirm) end super *args, &block end |
#link_to(*args, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 |
# File 'lib/sweet-alert-confirm/view_helpers.rb', line 3 def link_to(*args, &block) = args[block_given? ? 1 : 2] || {} if () ['data-sweet-alert-confirm'] = .delete(:confirm) || [:data].delete(:confirm) end super *args, &block end |
#submit_tag(value = 'Save changes', options = {}) ⇒ Object
13 14 15 16 |
# File 'lib/sweet-alert-confirm/view_helpers.rb', line 13 def submit_tag(value = 'Save changes', = {}) ['data-sweet-alert-confirm'] = .delete(:confirm) || [:data].delete(:confirm) if () super value, end |