Class: FoxTail::SurfaceComponent
- Inherits:
-
ClickableComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- ClickableComponent
- FoxTail::SurfaceComponent
- Defined in:
- app/components/fox_tail/surface_component.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from BaseComponent
Instance Method Summary collapse
Methods inherited from ClickableComponent
#link?, stimulus_controller_name, #stimulus_controller_options, #use_stimulus?
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
12 13 14 15 16 |
# File 'app/components/fox_tail/surface_component.rb', line 12 def before_render super html_attributes[:class] = classnames theme.apply(:root, self), html_class end |
#call ⇒ Object
18 19 20 |
# File 'app/components/fox_tail/surface_component.rb', line 18 def call content_tag root_tag_name, content, html_attributes end |
#root_tag_name ⇒ Object
8 9 10 |
# File 'app/components/fox_tail/surface_component.rb', line 8 def root_tag_name link? ? :a : tag_name end |