Sha256: cfd9ce8cbbaf1e390dfa6cc1a71ba5620380d944962a9da13723115bfe0c4bb4

Contents?: true

Size: 953 Bytes

Versions: 5

Compression:

Stored size: 953 Bytes

Contents

module Effective
  module FormInputs
    class Submit < Effective::FormInput

      def build_input(&block)
        content_tag(:button, name, options[:input])
      end

      def wrapper_options
        if layout == :horizontal
          { class: 'form-group row form-actions'}
        else
          { class: 'form-group form-actions'}
        end
      end

      def input_html_options
        { class: 'btn btn-primary', type: 'submit', name: 'commit', value: name }
      end

      def label_options
        false
      end

      def feedback_options
        case layout
        when :inline
          false
        else
          {
            valid: { class: 'valid-feedback', text: 'Looks good! Submitting...' },
            invalid: {
              class: 'invalid-feedback',
              text: 'one or more errors are present. please fix the errors above and try again.'
            }
          }
        end
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
effective_bootstrap-0.0.5 app/models/effective/form_inputs/submit.rb
effective_bootstrap-0.0.4 app/models/effective/form_inputs/submit.rb
effective_bootstrap-0.0.3 app/models/effective/form_inputs/submit.rb
effective_bootstrap-0.0.2 app/models/effective/form_inputs/submit.rb
effective_bootstrap-0.0.1 app/models/effective/form_inputs/submit.rb