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
-
#label_html ⇒ Object
def control_label_html.
- #label_html_options ⇒ Object
Instance Method Details
#label_html ⇒ Object
def control_label_html
18 19 20 21 22 23 24 25 26 |
# File 'lib/formtastic-bootstrap/inputs/base/labelling.rb', line 18 def label_html if render_label? template.content_tag(:span, :class => 'form-label') do builder.label(input_name, label_text, ) end else "".html_safe end end |
#label_html_options ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/formtastic-bootstrap/inputs/base/labelling.rb', line 8 def super.tap do || # Bootstrap defines class 'label' too, so remove the # one that gets created by Formtastic. [:class] = [:class].reject { |c| c == 'label' } [:class] << " control-label" end end |