Class: TaoForm::Inputs::BooleanInput

Inherits:
SimpleForm::Inputs::BooleanInput
  • Object
show all
Defined in:
lib/tao_form/inputs/boolean_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options = nil) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/tao_form/inputs/boolean_input.rb', line 5

def input(wrapper_options = nil)
  merged_html_options = merge_wrapper_options(input_html_options, wrapper_options)
  merged_component_options = component_options.merge(merged_html_options)

  input_content = template.send(switch? ? :tao_switch : :tao_check_box,
    @builder, attribute_name, merged_component_options
  )

  template.(:div, input_content, class: 'boolean-field')
end