Class: FoxTail::Dropdown::ToggleItemComponent
- Inherits:
-
InputItemComponent
- Object
- InputItemComponent
- FoxTail::Dropdown::ToggleItemComponent
- Defined in:
- app/components/fox_tail/dropdown/toggle_item_component.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
10 11 12 |
# File 'app/components/fox_tail/dropdown/toggle_item_component.rb', line 10 def call content_tag :div, input_content, html_attributes end |
#id ⇒ Object
6 7 8 |
# File 'app/components/fox_tail/dropdown/toggle_item_component.rb', line 6 def id [:id] ||= multiple? ? tag_id_for_value(checked_value) : tag_id end |
#input_classes ⇒ Object
14 15 16 |
# File 'app/components/fox_tail/dropdown/toggle_item_component.rb', line 14 def input_classes classnames super, theme.apply(:checkbox, self) end |
#input_content ⇒ Object
18 19 20 21 22 |
# File 'app/components/fox_tail/dropdown/toggle_item_component.rb', line 18 def input_content render FoxTail::ToggleComponent.new(.merge(class: input_classes)) do |toggle| toggle.with_label(content) if content? end end |