Module: FormtasticBootstrap::Inputs::Base::Choices

Included in:
CheckBoxesInput, RadioInput
Defined in:
lib/formtastic-bootstrap/inputs/base/choices.rb

Instance Method Summary collapse

Instance Method Details

#choices_wrapping_html_optionsObject



12
13
14
15
# File 'lib/formtastic-bootstrap/inputs/base/choices.rb', line 12

def choices_wrapping_html_options
  new_class = [super[:class], "controls"].compact.join(" ")
  super.merge(:class => new_class)
end

#control_label_html_optionsObject



31
32
33
# File 'lib/formtastic-bootstrap/inputs/base/choices.rb', line 31

def control_label_html_options
  super.merge(:for => nil)
end

#input_div_wrapping(&block) ⇒ Object



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

def input_div_wrapping(&block)
  template.(:div, choices_wrapping_html_options) do
    [yield, error_html(:block), hint_html(:block)].join("\n").html_safe
  end
end

#legend_htmlObject

This is actually a label in Bootstrap.



25
26
27
28
29
# File 'lib/formtastic-bootstrap/inputs/base/choices.rb', line 25

def legend_html
  template.(:label, control_label_html_options) do
    render_label? ? label_text : "".html_safe
  end
end