Sha256: a0b2fde702c03c268bd0d707a11f4ad005760b132c4e648cd041ef98bdc5a945
Contents?: true
Size: 568 Bytes
Versions: 33
Compression:
Stored size: 568 Bytes
Contents
module GOVUKDesignSystemFormBuilder module Elements class ErrorMessage < Base using PrefixableArray include Traits::Error def html return unless has_errors? tag.p(class: %(#{brand}-error-message), id: error_id) do safe_join([hidden_prefix, message]) end end private def hidden_prefix tag.span('Error: ', class: %(#{brand}-visually-hidden)) end def message set_message_safety(@builder.object.errors.messages[@attribute_name]&.first) end end end end
Version data entries
33 entries across 33 versions & 2 rubygems