Class: FoxTail::ToggleComponent
- Inherits:
-
CheckboxComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- CheckboxComponent
- FoxTail::ToggleComponent
- Defined in:
- app/components/fox_tail/toggle_component.rb
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
Methods inherited from CheckboxComponent
#checked?, stimulus_controller_name, #stimulus_controller_options, #use_stimulus?, #value
Methods inherited from BaseComponent
classname_merger, #initialize, stimulus_merger, use_stimulus?, #with_html_attributes, #with_html_class
Methods inherited from Base
Constructor Details
This class inherits a constructor from FoxTail::BaseComponent
Instance Method Details
#before_render ⇒ Object
6 7 8 9 10 |
# File 'app/components/fox_tail/toggle_component.rb', line 6 def before_render super html_attributes[:class] = theme.apply(:root, self) end |
#call ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/components/fox_tail/toggle_component.rb', line 12 def call content_tag :label, container_attributes do concat super concat content_tag(:div, nil, toggle_attributes) concat label if label? concat content if content? end end |