Class: ActionAdmin::ToggleInput
- Inherits:
-
SimpleForm::Inputs::BooleanInput
- Object
- SimpleForm::Inputs::BooleanInput
- ActionAdmin::ToggleInput
- Defined in:
- app/inputs/action_admin/toggle_input.rb
Instance Method Summary collapse
- #field_input(wrapper_options) ⇒ Object
- #field_name ⇒ Object
- #input(wrapper_options) ⇒ Object
- #label_input(wrapper_options) ⇒ Object
- #nested_boolean_style? ⇒ Boolean
Instance Method Details
#field_input(wrapper_options) ⇒ Object
24 25 26 |
# File 'app/inputs/action_admin/toggle_input.rb', line 24 def field_input() content_tag :div, input() + label(), class: 'switch tiny' end |
#field_name ⇒ Object
28 29 30 |
# File 'app/inputs/action_admin/toggle_input.rb', line 28 def field_name content_tag :label, @initial_label_text end |
#input(wrapper_options) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'app/inputs/action_admin/toggle_input.rb', line 3 def input() @initial_label_text = raw_label_text [:class] ||= [] [:class] << 'switch-input' [:label_html] = { class: 'switch-paddle' } [:label] = content_tag :span, raw_label_text, class: 'show-for-sr' super end |
#label_input(wrapper_options) ⇒ Object
15 16 17 18 19 20 21 22 |
# File 'app/inputs/action_admin/toggle_input.rb', line 15 def label_input() field_html = field_input() template.content_tag :div, class: 'grid-x' do template.concat content_tag(:div, field_name, class: 'cell auto') template.concat content_tag(:div, field_html, class: 'cell shrink') end end |
#nested_boolean_style? ⇒ Boolean
32 33 34 |
# File 'app/inputs/action_admin/toggle_input.rb', line 32 def nested_boolean_style? false end |