Class: FormtasticRebootstrap::Inputs::BooleanInput
- Inherits:
-
Formtastic::Inputs::BooleanInput
- Object
- Formtastic::Inputs::BooleanInput
- FormtasticRebootstrap::Inputs::BooleanInput
- Includes:
- Base
- Defined in:
- lib/formtastic_rebootstrap/inputs/boolean_input.rb
Instance Method Summary collapse
- #checkbox_wrapping(&block) ⇒ Object
- #hidden_field_html ⇒ Object
- #label_with_nested_checkbox ⇒ Object
-
#render_label? ⇒ Boolean
Skip rendering of .form-label in #bootstrap_wrapping.
- #to_html ⇒ Object
- #wrapper_html_options ⇒ Object
Methods included from FormtasticRebootstrap::Inputs::Base::Wrapping
#add_on_content, #add_on_wrapper_classes, #bootstrap_wrapping, #form_group_wrapping, #input_content, #input_default_col, #input_options_classes, #prepended_or_appended?, #wrapping_class_with_col
Methods included from FormtasticRebootstrap::Inputs::Base::Labelling
#label_class_with_col, #label_html, #label_html_options, #layout_classes
Methods included from FormtasticRebootstrap::Inputs::Base::Hints
Methods included from FormtasticRebootstrap::Inputs::Base::Errors
#error_first_html, #error_html, #error_list_html, #error_none_html, #error_sentence_html
Methods included from FormtasticRebootstrap::Inputs::Base::Html
#form_control_input_html_options, #input_class_without_col, #input_html_options, #original_classes
Instance Method Details
#checkbox_wrapping(&block) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/formtastic_rebootstrap/inputs/boolean_input.rb', line 36 def checkbox_wrapping(&block) template.content_tag(:div, template.capture(&block).html_safe, ) end |
#hidden_field_html ⇒ Object
19 20 21 22 23 24 25 26 |
# File 'lib/formtastic_rebootstrap/inputs/boolean_input.rb', line 19 def hidden_field_html template.hidden_field_tag( [:name], unchecked_value, :id => nil, :disabled => [:disabled] ) end |
#label_with_nested_checkbox ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/formtastic_rebootstrap/inputs/boolean_input.rb', line 28 def label_with_nested_checkbox builder.label( method, , ) end |
#render_label? ⇒ Boolean
Skip rendering of .form-label in #bootstrap_wrapping
8 9 10 |
# File 'lib/formtastic_rebootstrap/inputs/boolean_input.rb', line 8 def render_label? true end |
#to_html ⇒ Object
12 13 14 15 16 17 |
# File 'lib/formtastic_rebootstrap/inputs/boolean_input.rb', line 12 def to_html bootstrap_wrapping do hidden_field_html << check_box_html end end |
#wrapper_html_options ⇒ Object
43 44 45 46 47 |
# File 'lib/formtastic_rebootstrap/inputs/boolean_input.rb', line 43 def super.tap do || [:class] = ([:class].split + ["checkbox"]).join(" ") end end |