Class: DesignSystem::Generic::Builders::Notification
- Includes:
- ActionView::Helpers::SanitizeHelper
- Defined in:
- lib/design_system/generic/builders/notification.rb
Overview
This class provides generic methods to display notifications.
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Base
Methods included from Helpers::CssHelper
Methods included from Concerns::BrandDerivable
Constructor Details
This class inherits a constructor from DesignSystem::Generic::Builders::Base
Instance Method Details
#render_alert(msg) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/design_system/generic/builders/notification.rb', line 10 def render_alert(msg) content_tag(:div, class: "#{brand}-error-summary", 'aria-labelledby': 'error-summary-title', role: 'alert', tabindex: '-1') do content_tag(:h2, sanitize(msg, tags: %w[b p br a], attributes: %w[href target]), class: "#{brand}-error-summary__title", id: 'error-summary-title') end end |
#render_notice(msg) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/design_system/generic/builders/notification.rb', line 18 def render_notice(msg) content_tag(:div, class: "#{brand}-notification-banner", role: 'region', 'aria-labelledby': "#{brand}-notification-banner-title", 'data-module': "#{brand}-notification-banner") do + (msg) end end |