Class: DesignSystem::Generic::AlertComponent
- Inherits:
-
BaseComponent
- Object
- ViewComponent::Base
- BaseComponent
- DesignSystem::Generic::AlertComponent
- Defined in:
- app/components/design_system/generic/alert_component.rb
Overview
Error-summary alert rendered by ds_alert. Content comes from the message argument or a block.
Direct Known Subclasses
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(message = nil) ⇒ AlertComponent
constructor
A new instance of AlertComponent.
Methods included from Helpers::CssHelper
Methods included from BrandDerivable
Constructor Details
#initialize(message = nil) ⇒ AlertComponent
Returns a new instance of AlertComponent.
6 7 8 9 |
# File 'app/components/design_system/generic/alert_component.rb', line 6 def initialize( = nil) super() @message = end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 |
# File 'app/components/design_system/generic/alert_component.rb', line 11 def call content_tag(:div, class: "#{brand}-error-summary", 'aria-labelledby': 'error-summary-title', role: 'alert', tabindex: '-1') do content_tag(:h2, body, class: "#{brand}-error-summary__title", id: 'error-summary-title') end end |