Module: EffectiveResourcesHelper

Defined in:
app/helpers/effective_resources_helper.rb

Instance Method Summary collapse

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, options = {class: 'text-right'}, &block)
  (:p, class: options[:class]) do
    form.button(: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, options = {class: 'text-right'}, &block)
  (:p, class: options[:class]) do
    [
      form.button(:submit, 'Save', data: { disable_with: 'Saving...' }),
      form.button(:submit, 'Save and Continue', data: { disable_with: 'Saving...' }),
      form.button(:submit, 'Save and Add New', data: { disable_with: 'Saving...' }),
      (capture(&block) if block_given?)
    ].compact.join(' ').html_safe
  end
end