Sha256: e1208add717f0a14681f872624b24db08db816d054100545225b015fdc020dbb

Contents?: true

Size: 757 Bytes

Versions: 3

Compression:

Stored size: 757 Bytes

Contents

module Effective
  module FormBuilderInputs
    class EffectiveEmail < Effective::FormBuilderInput
      delegate :content_tag, :email_field_tag, :to => :@template

      def default_input_html
        {
          class: 'effective_email email',
          placeholder: 'someone@example.com',
        }
      end

      def to_html
        if options[:input_group] == false
          return email_field_tag(field_name, value, tag_options)
        end

        content_tag(:div, class: 'input-group') do
          content_tag(:span, class: 'input-group-addon') do
            content_tag(:i, '', class: 'glyphicon glyphicon-envelope').html_safe
          end +
          email_field_tag(field_name, value, tag_options)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
effective_form_inputs-1.5.0 app/models/effective/form_builder_inputs/effective_email.rb
effective_form_inputs-1.4.1 app/models/effective/form_builder_inputs/effective_email.rb
effective_form_inputs-1.4.0 app/models/effective/form_builder_inputs/effective_email.rb