Class: GOVUKDesignSystemFormBuilder::Containers::Supplemental

Inherits:
Base
  • Object
show all
Defined in:
lib/govuk_design_system_formbuilder/containers/supplemental.rb

Instance Method Summary collapse

Methods inherited from Base

#field_id, #to_s

Constructor Details

#initialize(builder, object_name, attribute_name, content) ⇒ Supplemental

Returns a new instance of Supplemental.



4
5
6
7
8
# File 'lib/govuk_design_system_formbuilder/containers/supplemental.rb', line 4

def initialize(builder, object_name, attribute_name, content)
  super(builder, object_name, attribute_name)

  @content = content
end

Instance Method Details

#htmlObject



10
11
12
13
14
15
16
# File 'lib/govuk_design_system_formbuilder/containers/supplemental.rb', line 10

def html
  return if @content.blank?

  warn("Supplemental content is deprecated and support will soon be removed. See https://github.com/x-govuk/govuk-form-builder/issues/445")

  tag.div(id: supplemental_id) { @content }
end