Module: CCS::FrontendHelpers::GovUKFrontend::CookieBanner

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

Overview

GOV.UK Cookie Banner

This helper is used for generating the cookie banner component from the GDS - Components - Cookie banner

Instance Method Summary collapse

Instance Method Details

Generates the HTML for the GOV.UK Cookie banner component

Parameters:

  • messages (Array<Hash>)

    An array of messages for the cookie banner. See Message#initialize for details of the items in the array.

  • options (Hash)

    options that will be used in customising the HTML

Options Hash (**options):

  • :classes (String)

    additional CSS classes for the cookie banner HTML

  • :attributes (Hash)

    any additional attributes that will added as part of the HTML

Returns:

  • (ActiveSupport::SafeBuffer)


22
23
24
# File 'lib/ccs/frontend_helpers/govuk_frontend/cookie_banner.rb', line 22

def govuk_cookie_banner(messages, **options)
  Components::GovUK::CookieBanner.new(context: self, messages: messages, **options).render
end