Module: EffectiveResourcesHelper
- Defined in:
- app/helpers/effective_resources_helper.rb
Instance Method Summary collapse
- #simple_form_save(form, options = {class: 'text-right'}, &block) ⇒ Object
- #simple_form_submit(form, options = {class: 'text-right'}, &block) ⇒ Object
Instance Method Details
#simple_form_save(form, options = {class: 'text-right'}, &block) ⇒ Object
14 15 16 17 18 |
# File 'app/helpers/effective_resources_helper.rb', line 14 def simple_form_save(form, = {class: 'text-right'}, &block) content_tag(:p, class: [:class]) do form.(:submit, 'Save', data: { disable_with: 'Saving...' }) + (capture(&:block) if block_given?) end end |
#simple_form_submit(form, options = {class: 'text-right'}, &block) ⇒ Object
3 4 5 6 7 8 9 10 11 12 |
# File 'app/helpers/effective_resources_helper.rb', line 3 def simple_form_submit(form, = {class: 'text-right'}, &block) content_tag(:p, class: [:class]) do [ form.(:submit, 'Save', data: { disable_with: 'Saving...' }), form.(:submit, 'Save and Continue', data: { disable_with: 'Saving...' }), form.(:submit, 'Save and Add New', data: { disable_with: 'Saving...' }), (capture(&block) if block_given?) ].compact.join(' ').html_safe end end |