Sha256: 6207d1e7ce1ddb707faf906d6e51d93faa8a861954c5907548429cf01c8c88fb

Contents?: true

Size: 701 Bytes

Versions: 5

Compression:

Stored size: 701 Bytes

Contents

module ExpressTemplates
  module Components
    module Forms
      class Submit < FormComponent

        has_option :button_class, 'The css class of the input button.'
        has_option :value, 'The value of the submit tag.  Text show in button.',
                           default: 'Save'

        contains -> {
          submit_tag(value, input_attributes)
        }

        before_build -> {
          # if we are not part of a form, we don't get a default id
          begin
            super()
          rescue
            add_class(config[:class])
            remove_class('submit')
          end
        }

        def value
          config[:value]
        end

      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
express_admin-1.4.2 vendor/gems/express_templates/lib/express_templates/components/forms/submit.rb
express_templates-0.9.0 lib/express_templates/components/forms/submit.rb
express_admin-1.4.1 vendor/gems/express_templates/lib/express_templates/components/forms/submit.rb
express_admin-1.4.0 vendor/gems/express_templates/lib/express_templates/components/forms/submit.rb
express_templates-0.8.0 lib/express_templates/components/forms/submit.rb