Module: GOVUKDesignSystemFormBuilder::Traits::Input

Instance Method Summary collapse

Instance Method Details

#htmlObject



17
18
19
20
21
# File 'lib/govuk_design_system_formbuilder/traits/input.rb', line 17

def html
  Containers::FormGroup.new(*bound, **@form_group).html do
    safe_join([label_element, supplemental_content, hint_element, error_element, content])
  end
end

#initialize(builder, object_name, attribute_name, hint:, label:, caption:, prefix_text:, suffix_text:, width:, form_group:, **kwargs, &block) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/govuk_design_system_formbuilder/traits/input.rb', line 4

def initialize(builder, object_name, attribute_name, hint:, label:, caption:, prefix_text:, suffix_text:, width:, form_group:, **kwargs, &block)
  super(builder, object_name, attribute_name, &block)

  @width           = width
  @label           = label
  @caption         = caption
  @hint            = hint
  @prefix_text     = prefix_text
  @suffix_text     = suffix_text
  @html_attributes = kwargs
  @form_group      = form_group
end