Module: CCS::FrontendHelpers::GovUKFrontend::Button

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

Overview

GOV.UK Button

This helper is used for generating the button component from the GDS - Components - Button

Instance Method Summary collapse

Instance Method Details

#govuk_button(text) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK button component

Parameters:

  • text (String)

    the text that will be shown in the button

  • options (Hash)

    options that will be used in customising the HTML

Returns:

  • (ActiveSupport::SafeBuffer)


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

def govuk_button(text, **)
  Components::GovUK::Button.new(context: self, text: text, **).render
end