Module: CCS::FrontendHelpers::GovUKFrontend::Fieldset

Included in:
CCS::FrontendHelpers::GovUKFrontend
Defined in:
lib/ccs/frontend_helpers/govuk_frontend/fieldset.rb

Overview

GOV.UK Fieldset

This helper is used for generating the fieldset component from the GDS - Components - Fieldset

Instance Method Summary collapse

Instance Method Details

#govuk_fieldset(**options) { ... } ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Fieldset component

Parameters:

  • legend (Hash)

    options for the fieldset legend. See Legend#initialize for details of the options.

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the fieldset HTML

  • :attributes (Hash) — default: {}

    any additional attributes that will added as part of the HTML

Yields:

  • HTML that will be contained within the ‘govuk-fieldset’ div and under the legend

Returns:

  • (ActiveSupport::SafeBuffer)


24
25
26
# File 'lib/ccs/frontend_helpers/govuk_frontend/fieldset.rb', line 24

def govuk_fieldset(**options, &)
  Components::GovUK::Fieldset.new(context: self, **options).render(&)
end