Module: FormtasticBootstrap::Inputs::Base::Labelling

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

Instance Method Summary collapse

Instance Method Details

#control_label_html_optionsObject



20
21
22
23
# File 'lib/formtastic-bootstrap/inputs/base/labelling.rb', line 20

def control_label_html_options
  new_class = [label_html_options[:class], "control-label"].compact.join(" ")
  label_html_options.merge(:class => new_class)
end

#label_htmlObject



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

def label_html
  render_label? ? builder.label(input_name, label_text, control_label_html_options) : "".html_safe
end

#label_html_optionsObject



12
13
14
15
16
17
18
# File 'lib/formtastic-bootstrap/inputs/base/labelling.rb', line 12

def label_html_options
  opts = {}
  opts[:for] ||= input_html_options[:id]
  opts[:class] = [opts[:class]]

  opts
end