Class: DesignSystem::Govuk::Builders::Panel

Inherits:
DesignSystem::Generic::Builders::Panel show all
Defined in:
lib/design_system/govuk/builders/panel.rb

Overview

This generates html for rendering panel for Govuk

Instance Method Summary collapse

Methods inherited from DesignSystem::Generic::Builders::Base

#initialize

Methods included from Helpers::CssHelper

#css_class_options_merge

Methods included from DesignSystem::Generic::Builders::Concerns::BrandDerivable

#brand

Constructor Details

This class inherits a constructor from DesignSystem::Generic::Builders::Base

Instance Method Details

#render_panel(title, body) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/design_system/govuk/builders/panel.rb', line 8

def render_panel(title, body)
  safe_buffer = ActiveSupport::SafeBuffer.new
  (:div, class: "#{brand}-panel #{brand}-panel--confirmation") do
    safe_buffer.concat((:h1, title, class: "#{brand}-panel__title"))
    safe_buffer.concat((:div, body, class: "#{brand}-panel__body"))
  end
end