Class: GOVUKDesignSystemFormBuilder::Containers::FormGroup

Inherits:
Base
  • Object
show all
Includes:
Traits::HTMLAttributes, Traits::HTMLClasses
Defined in:
lib/govuk_design_system_formbuilder/containers/form_group.rb

Instance Method Summary collapse

Methods included from Traits::HTMLClasses

#build_classes

Methods included from Traits::HTMLAttributes

#attributes

Methods inherited from Base

#field_id, #to_s

Constructor Details

#initialize(builder, object_name, attribute_name, **kwargs) ⇒ FormGroup

Returns a new instance of FormGroup.



7
8
9
10
11
# File 'lib/govuk_design_system_formbuilder/containers/form_group.rb', line 7

def initialize(builder, object_name, attribute_name, **kwargs)
  super(builder, object_name, attribute_name)

  @html_attributes = kwargs
end

Instance Method Details

#html(&block) ⇒ Object



13
14
15
# File 'lib/govuk_design_system_formbuilder/containers/form_group.rb', line 13

def html(&block)
  tag.div(**attributes(@html_attributes), &block)
end