Class: FormtasticBootstrap::Inputs::BooleanInput

Inherits:
Formtastic::Inputs::BooleanInput
  • Object
show all
Includes:
Base
Defined in:
lib/formtastic-bootstrap/inputs/boolean_input.rb

Instance Method Summary collapse

Methods included from FormtasticBootstrap::Inputs::Base::Wrapping

#appended_input_wrapping, #bootstrap_wrapping, #control_group_wrapping, #controls_wrapper_html_options, #controls_wrapping, #prepended_and_appended_input_wrapping, #prepended_input_wrapping, #wrapper_html_options

Methods included from FormtasticBootstrap::Inputs::Base::Labelling

#control_label_html, #control_label_html_options, #label_html_options

Methods included from FormtasticBootstrap::Inputs::Base::Hints

#hint_html

Methods included from FormtasticBootstrap::Inputs::Base::Errors

#error_first_html, #error_html, #error_list_html, #error_none_html, #error_sentence_html

Methods included from FormtasticBootstrap::Inputs::Base::Html

#input_html_options

Instance Method Details

#label_with_nested_checkboxObject



17
18
19
20
21
22
23
24
25
# File 'lib/formtastic-bootstrap/inputs/boolean_input.rb', line 17

def label_with_nested_checkbox
  builder.label(
    method,
    options[:label_outside] ? check_box_html : label_text_with_embedded_checkbox,
    label_html_options.tap do |options|
      options[:class] << "checkbox"
    end
  )
end

#to_htmlObject



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

def to_html
  control_group_wrapping do
    (options[:label_outside] ? control_label_html : "".html_safe) <<
    hidden_field_html <<
    controls_wrapping do
      label_with_nested_checkbox
    end
  end
end