Sha256: eb3512a3648342036e500043ac029ee6f9938d2fbaad553396587b88abc5aab8

Contents?: true

Size: 748 Bytes

Versions: 3

Compression:

Stored size: 748 Bytes

Contents

module EffectiveResourcesHelper

  def simple_form_submit(form, options = {class: 'text-right'}, &block)
    content_tag(: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

  def simple_form_save(form, options = {class: 'text-right'}, &block)
    content_tag(:p, class: options[:class]) do
      form.button(:submit, 'Save', data: { disable_with: 'Saving...' }) + (capture(&:block) if block_given?)
    end
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_resources-0.2.4 app/helpers/effective_resources_helper.rb
effective_resources-0.2.3 app/helpers/effective_resources_helper.rb
effective_resources-0.2.2 app/helpers/effective_resources_helper.rb