Class: FoxTail::BadgeComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- Base
- BaseComponent
- FoxTail::BadgeComponent
- Defined in:
- app/components/fox_tail/badge_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
#call ⇒ Object
18 19 20 21 22 23 |
# File 'app/components/fox_tail/badge_component.rb', line 18 def call content_tag (url? ? :a : :span), html_attributes.merge(href: url, class: root_classes) do concat icon if icon? concat content_tag(:span, content, class: content_classes) if content? end end |