Class: Inputs::EffectiveEmail::Input

Inherits:
Effective::FormInput show all
Defined in:
app/models/inputs/effective_email/input.rb

Instance Method Summary collapse

Methods inherited from Effective::FormInput

#field_name, #html_options, #initialize, #js_options, #options, #value

Constructor Details

This class inherits a constructor from Effective::FormInput

Instance Method Details

#default_input_htmlObject



6
7
8
9
10
11
# File 'app/models/inputs/effective_email/input.rb', line 6

def default_input_html
  {
    class: 'effective_email email',
    placeholder: '[email protected]',
  }
end

#to_htmlObject



13
14
15
16
17
18
19
20
21
22
23
24
# File 'app/models/inputs/effective_email/input.rb', line 13

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

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