Class: SimpleForm::Inputs::SwitchInput
- Inherits:
-
BooleanInput
- Object
- BooleanInput
- SimpleForm::Inputs::SwitchInput
- Defined in:
- lib/mtl/simple_form/switch_input.rb
Overview
:nodoc:
Instance Method Summary collapse
- #input(_wrapper_options = nil) ⇒ Object
- #label(_wrapper_options = nil) ⇒ Object
- #label_input(wrapper_options = nil) ⇒ Object
Instance Method Details
#input(_wrapper_options = nil) ⇒ Object
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/mtl/simple_form/switch_input.rb', line 9 def input( = nil) template.content_tag(:div, class: :switch) do build_hidden_field_for_checkbox + template.label_tag(nil) do build_check_box_without_hidden_field() + template.content_tag(:span, nil, class: :lever) + label_text end end end |
#label(_wrapper_options = nil) ⇒ Object
24 25 26 |
# File 'lib/mtl/simple_form/switch_input.rb', line 24 def label( = nil) '' end |
#label_input(wrapper_options = nil) ⇒ Object
20 21 22 |
# File 'lib/mtl/simple_form/switch_input.rb', line 20 def label_input( = nil) input() end |