Sha256: 23908297c3b37115b5307d2c074c8d89acf0d40d8e54f3ea13c4c80f1b0cbc8d

Contents?: true

Size: 563 Bytes

Versions: 3

Compression:

Stored size: 563 Bytes

Contents

module ExpressTemplates
  module Components
    module Forms
      class Submit < FormComponent

        def build(*args)
          div(class: field_wrapper_class) {
            if args.first.is_a?(String) or args.empty?
              submit_tag(args.first || 'Save', (args[1]||{}))
            else
              submit_tag 'Save', (args.first || {})
            end
          }
        end

        def value
          if @args.first.is_a?(String)
            @args.first
          else
            'Save'
          end
        end

      end
    end
  end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
express_admin-1.3.2 vendor/gems/express_templates/lib/express_templates/components/forms/submit.rb
express_admin-1.3.1 vendor/gems/express_templates/lib/express_templates/components/forms/submit.rb
express_templates-0.7.1 lib/express_templates/components/forms/submit.rb