Class: SimpleForm::Inputs::SwitchInput

Inherits:
BooleanInput
  • Object
show all
Defined in:
lib/mtl/simple_form/switch_input.rb

Overview

:nodoc:

Instance Method Summary collapse

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(_wrapper_options = nil)
  template.(:div, class: :switch) do
    build_hidden_field_for_checkbox +
      template.label_tag(nil) do
        build_check_box_without_hidden_field(input_html_options) +
          template.(: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(_wrapper_options = nil)
  ''
end

#label_input(wrapper_options = nil) ⇒ Object



20
21
22
# File 'lib/mtl/simple_form/switch_input.rb', line 20

def label_input(wrapper_options = nil)
  input(wrapper_options)
end