Class: DesignSystem::Generic::Builders::Callout
- Defined in:
- lib/design_system/generic/builders/callout.rb
Overview
This generates html for rendering warning callout to help users identify and understand warning content on the page, even if they do not read the whole page.
Direct Known Subclasses
DesignSystem::Govuk::Builders::Callout, Nhsuk::Builders::Callout
Instance Method Summary collapse
Methods inherited from 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/generic/builders/callout.rb', line 8 def render_callout(label, body) safe_buffer = ActiveSupport::SafeBuffer.new content_tag(:div, class: "#{brand}-warning-callout") do safe_buffer.concat(render_label(label)) safe_buffer.concat(content_tag(:p, body)) end end |