Sha256: 1b6076d301221b7c448f8fcc4e41be406ee9188705b07da621e36298e3934499

Contents?: true

Size: 421 Bytes

Versions: 5

Compression:

Stored size: 421 Bytes

Contents

class SwitchInput < SimpleForm::Inputs::BooleanInput
  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
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
simple_form_custom_inputs-0.1.0 lib/simple_form_custom_inputs/simple_form/switch_input.rb
simple_form_custom_inputs-0.0.4 lib/simple_form_custom_inputs/simple_form/switch_input.rb
simple_form_custom_inputs-0.0.3 lib/simple_form_custom_inputs/simple_form/switch_input.rb
simple_form_custom_inputs-0.0.2 lib/simple_form_custom_inputs/simple_form/switch_input.rb
simple_form_custom_inputs-0.0.1 lib/simple_form_custom_inputs/simple_form/switch_input.rb