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_htmlObject



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

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

#control_label_html_optionsObject



16
17
18
19
20
# File 'lib/formtastic-bootstrap/inputs/base/labelling.rb', line 16

def control_label_html_options
  label_html_options.tap do |options|
    options[:class] << "control-label"
  end
end

#label_html_optionsObject



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

def label_html_options
  super.tap do |options|
    # Bootstrap defines class 'label'
    options[:class] = options[:class].reject { |c| c == 'label' }
    # options[:class] << "control-label"
  end
end