Class: UI::AlertComponent
- Inherits:
-
ViewComponent::Base
- Object
- ViewComponent::Base
- UI::AlertComponent
- Includes:
- AlertBehavior
- Defined in:
- app/view_components/ui/alert_component.rb
Overview
Alert - ViewComponent implementation
A callout component for displaying important information to users.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(variant: :default, classes: "", **attributes) ⇒ AlertComponent
constructor
A new instance of AlertComponent.
Methods included from AlertBehavior
#alert_base_classes, #alert_classes, #alert_html_attributes, #alert_variant_classes, #render_alert
Constructor Details
#initialize(variant: :default, classes: "", **attributes) ⇒ AlertComponent
Returns a new instance of AlertComponent.
12 13 14 15 16 |
# File 'app/view_components/ui/alert_component.rb', line 12 def initialize(variant: :default, classes: "", **attributes) @variant = variant @classes = classes @attributes = attributes end |
Instance Method Details
#call ⇒ Object
18 19 20 21 22 |
# File 'app/view_components/ui/alert_component.rb', line 18 def call tag.div(**alert_html_attributes) do content end end |