Method: CCS::FrontendHelpers::GovUKFrontend::ErrorMessage#govuk_error_message

Defined in:
lib/ccs/frontend_helpers/govuk_frontend/error_message.rb

#govuk_error_message(error_message, attribute = nil) ⇒ ActiveSupport::SafeBuffer

Generates the HTML for the GOV.UK Error message component

Parameters:

  • message (String)

    the message to be displayed

  • attribute (String, Symbol) (defaults to: nil)

    the attribute that has an error

  • options (Hash)

    options that will be used in customising the HTML

Returns:

  • (ActiveSupport::SafeBuffer)


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

def govuk_error_message(error_message, attribute = nil, **)
  Components::GovUK::ErrorMessage.new(context: self, message: error_message, attribute: attribute, **).render
end