Class: FoxTail::CheckboxComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- FoxTail::CheckboxComponent
- Defined in:
- app/components/fox_tail/checkbox_component.rb
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
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
10 11 12 13 14 15 16 |
# File 'app/components/fox_tail/checkbox_component.rb', line 10 def before_render super html_attributes[:type] = :checkbox html_attributes[:class] = classnames theme.apply(:root, self), html_class html_attributes[:value] = checked_value end |
#call ⇒ Object
18 19 20 21 22 23 |
# File 'app/components/fox_tail/checkbox_component.rb', line 18 def call capture do concat tag(:input, hidden_attributes) if include_hidden? concat tag(:input, html_attributes) end end |