Class: GOVUKDesignSystemFormBuilder::Containers::FormGroup

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

Instance Method Summary collapse

Methods inherited from Base

#field_id, #to_s

Constructor Details

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

Returns a new instance of FormGroup.


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

def initialize(builder, object_name, attribute_name, classes: nil, **kwargs)
  super(builder, object_name, attribute_name)

  @classes         = classes
  @html_attributes = kwargs
end

Instance Method Details

#html(&block) ⇒ Object


11
12
13
# File 'lib/govuk_design_system_formbuilder/containers/form_group.rb', line 11

def html(&block)
  tag.div(class: classes, **@html_attributes, &block)
end