Class: Katalyst::GOVUK::FormBuilder::Elements::Combobox

Inherits:
GOVUKDesignSystemFormBuilder::Base
  • Object
show all
Includes:
GOVUKDesignSystemFormBuilder::Traits::Error, GOVUKDesignSystemFormBuilder::Traits::HTMLAttributes, GOVUKDesignSystemFormBuilder::Traits::Hint, GOVUKDesignSystemFormBuilder::Traits::Label
Defined in:
lib/katalyst/govuk/form_builder/elements/combobox.rb

Instance Method Summary collapse

Constructor Details

#initialize(builder, object_name, attribute_name, options_or_src, options:, form_group:, label:, hint:, caption:, **kwargs, &block) ⇒ Combobox

Returns a new instance of Combobox.



15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/katalyst/govuk/form_builder/elements/combobox.rb', line 15

def initialize(builder, object_name, attribute_name, options_or_src, options:, form_group:, label:, hint:,
               caption:, **kwargs, &block)
  super(builder, object_name, attribute_name)
  @block           = block

  @form_group      = form_group
  @hint            = hint
  @label           = label
  @caption         = caption
  @options_or_src  = options_or_src
  @options         = options
  @html_attributes = kwargs
end

Instance Method Details

#htmlObject



29
30
31
32
33
# File 'lib/katalyst/govuk/form_builder/elements/combobox.rb', line 29

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