Class: FlexaFormtasticBootstrap::Inputs::BooleanInput
- Inherits:
-
Formtastic::Inputs::BooleanInput
- Object
- Formtastic::Inputs::BooleanInput
- FlexaFormtasticBootstrap::Inputs::BooleanInput
- Includes:
- Base
- Defined in:
- lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb,
lib/flexa_formtastic_bootstrap/inputs/OLD_boolean_input.rb
Instance Method Summary collapse
-
#empty_label ⇒ Object
Need this for formatting to work.
- #label_text_with_embedded_checkbox ⇒ Object
- #to_html ⇒ Object
- #wrapper_html_options ⇒ Object
Methods included from FlexaFormtasticBootstrap::Inputs::Base::Wrapping
#clearfix_div_wrapping, #generic_input_wrapping, #inline_inputs_div_wrapping, #input_div_wrapping, #prepended_input_wrapping
Methods included from FlexaFormtasticBootstrap::Inputs::Base::Labelling
Methods included from FlexaFormtasticBootstrap::Inputs::Base::Html
Methods included from FlexaFormtasticBootstrap::Inputs::Base::Hints
Methods included from FlexaFormtasticBootstrap::Inputs::Base::Errors
#error_first_html, #error_html, #error_list_html, #error_none_html, #error_sentence_html
Instance Method Details
#empty_label ⇒ Object
Need this for formatting to work.
33 34 35 |
# File 'lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb', line 33 def empty_label template.content_tag(:label) do end end |
#label_text_with_embedded_checkbox ⇒ Object
27 28 29 30 |
# File 'lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb', line 27 def # That newline matters! Why, I do no not know. check_box_html << "\n" << template.content_tag(:span) do label_text end end |
#to_html ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb', line 6 def to_html #options[:boolean][:class] = 'checkbox' #label_html_options.merge() clearfix_div_wrapping do #empty_label << hidden_field_html << input_div_wrapping(:block) do label_with_nested_checkbox end end end |
#wrapper_html_options ⇒ Object
22 23 24 25 |
# File 'lib/flexa_formtastic_bootstrap/inputs/boolean_input.rb', line 22 def new_class = [super[:class], "checkbox"].compact.join(" ") super.merge(:class => new_class) end |