Class: SwitchInput

Inherits:
SimpleForm::Inputs::BooleanInput
  • Object
show all
Defined in:
lib/simple_form_custom_inputs/simple_form/switch_input.rb

Instance Method Summary collapse

Instance Method Details

#input(wrapper_options) ⇒ Object



2
3
4
5
6
7
8
9
10
# File 'lib/simple_form_custom_inputs/simple_form/switch_input.rb', line 2

def input(wrapper_options)
  input_html_options[:class] ||= {}
  input_html_options[:class] << 'js-switch'

  input_html_options[:data] ||= {}
  input_html_options[:data].merge!({ color: "#12CA9E" }) unless input_html_options[:data][:color]
  input_html_options[:data].merge!({ size: "medium" }) unless input_html_options[:data][:size]
  super
end