Class: GOVUKDesignSystemFormBuilder::Elements::ErrorMessage

Inherits:
Base
  • Object
show all
Includes:
Traits::Error
Defined in:
lib/govuk_design_system_formbuilder/elements/error_message.rb

Instance Method Summary collapse

Methods included from Traits::Error

#error_id

Methods inherited from Base

#field_id, #initialize, #to_s

Constructor Details

This class inherits a constructor from GOVUKDesignSystemFormBuilder::Base

Instance Method Details

#htmlObject



8
9
10
11
12
13
14
# File 'lib/govuk_design_system_formbuilder/elements/error_message.rb', line 8

def html
  return unless has_errors?

  tag.p(class: %(#{brand}-error-message), id: error_id) do
    safe_join([hidden_prefix, message])
  end
end