Class: UI::AvatarFallbackComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::AvatarFallbackComponent
- Includes:
- AvatarFallbackBehavior
- Defined in:
- app/view_components/ui/avatar_fallback_component.rb
Overview
Avatar Fallback - ViewComponent implementation
Displays fallback content when the image hasn’t loaded or fails to load.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(classes: "", **attributes) ⇒ AvatarFallbackComponent
constructor
A new instance of AvatarFallbackComponent.
Methods included from AvatarFallbackBehavior
#avatar_fallback_classes, #avatar_fallback_data_attributes, #avatar_fallback_html_attributes
Constructor Details
#initialize(classes: "", **attributes) ⇒ AvatarFallbackComponent
Returns a new instance of AvatarFallbackComponent.
11 12 13 14 |
# File 'app/view_components/ui/avatar_fallback_component.rb', line 11 def initialize(classes: "", **attributes) @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 |
# File 'app/view_components/ui/avatar_fallback_component.rb', line 16 def call tag.span(**avatar_fallback_html_attributes.deep_merge(@attributes)) do content end end |