Module: FormtasticBootstrap::Inputs::Base::Html

Includes:
Formtastic::Inputs::Base::Html
Included in:
FormtasticBootstrap::Inputs::Base
Defined in:
lib/formtastic-bootstrap/inputs/base/html.rb

Instance Method Summary collapse

Instance Method Details

#form_control_input_html_optionsObject



8
9
10
11
12
# File 'lib/formtastic-bootstrap/inputs/base/html.rb', line 8

def form_control_input_html_options
  orig_class = input_html_options[:class]
  new_class = [orig_class, "form-control"].compact.join(" ")
  input_html_options.merge(:class => new_class)
end

#input_html_optionsObject



14
15
16
17
18
19
20
21
22
# File 'lib/formtastic-bootstrap/inputs/base/html.rb', line 14

def input_html_options
  if errors?
    {
      :class => "error"
    }.merge(super)
  else
    super
  end
end