Class: DesignSystem::Govuk::Builders::Callout
- Inherits:
-
DesignSystem::Generic::Builders::Callout
- Object
- DesignSystem::Generic::Builders::Base
- DesignSystem::Generic::Builders::Callout
- DesignSystem::Govuk::Builders::Callout
- Defined in:
- lib/design_system/govuk/builders/callout.rb
Overview
This generates html for rendering warning callout for Govuk
Instance Method Summary collapse
Methods inherited from DesignSystem::Generic::Builders::Base
Methods included from Helpers::CssHelper
Methods included from DesignSystem::Generic::Builders::Concerns::BrandDerivable
Constructor Details
This class inherits a constructor from DesignSystem::Generic::Builders::Base
Instance Method Details
#render_callout(label, body) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/design_system/govuk/builders/callout.rb', line 8 def render_callout(label, body) safe_buffer = ActiveSupport::SafeBuffer.new content_tag(:div, class: "#{brand}-warning-text") do safe_buffer.concat(content_tag(:span, '!', class: "#{brand}-warning-text__icon", 'aria-hidden': 'true')) safe_buffer.concat(render_body(label, body)) end end |