Module: Adminterface::Extensions::Inputs::BooleanInput

Includes:
Base
Included in:
ActiveAdmin::Inputs::BooleanInput
Defined in:
lib/adminterface/extensions/inputs/boolean_input.rb

Instance Method Summary collapse

Methods included from Adminterface::Extensions::Inputs::Base::ActiveAdminConfig

#active_admin_config, #inputs_config

Methods included from Adminterface::Extensions::Inputs::Base::Pluginish

#plugin?, #plugins_configs, #plugins_options

Methods included from Adminterface::Extensions::Inputs::Base::Wrapping

#input_wrapping, #input_wrapping_html, #wrapper_classes

Instance Method Details

#input_html_optionsObject



17
18
19
20
# File 'lib/adminterface/extensions/inputs/boolean_input.rb', line 17

def input_html_options
  opts = options[:input_html] || {}
  super.merge(class: "form-check-input #{opts[:class]}".squish)
end

#label_html_optionsObject



22
23
24
# File 'lib/adminterface/extensions/inputs/boolean_input.rb', line 22

def label_html_options
  super.merge(class: "form-check-label")
end

#to_htmlObject



7
8
9
10
11
12
13
14
15
# File 'lib/adminterface/extensions/inputs/boolean_input.rb', line 7

def to_html
  input_wrapping do
    template. :div, class: boolean_wrapper_class do
      hidden_field_html +
        check_box_html +
        label_html
    end
  end
end