Sha256: b2b5f2c5884a3057384ba2c387672cac76b6f8b0fd781ea55f1be112e068a013

Contents?: true

Size: 644 Bytes

Versions: 21

Compression:

Stored size: 644 Bytes

Contents

<%
  add_gem_component_stylesheet("error-message")

  id ||= "error-message-#{SecureRandom.hex(4)}"
  items ||= []
  right_to_left ||= false

  if items.any?
    errors = items.map { |item| capture { item[:text] } }
    text = raw(errors.join("<br />"))
  end

  component_helper = GovukPublishingComponents::Presenters::ComponentWrapperHelper.new(local_assigns)
  component_helper.set_id(id)
  component_helper.add_class("gem-c-error-message govuk-error-message")
  component_helper.set_dir("rtl") if right_to_left
%>
<%= tag.p(**component_helper.all_attributes) do %>
  <span class="govuk-visually-hidden">Error:</span> <%= text %>
<% end %>

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
govuk_publishing_components-49.1.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-49.0.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-48.0.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-47.0.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-46.4.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-46.3.1 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-46.3.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-46.2.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-46.1.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-46.0.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.10.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.9.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.8.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.7.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.6.1 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.6.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.5.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.4.1 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.4.0 app/views/govuk_publishing_components/components/_error_message.html.erb
govuk_publishing_components-45.3.0 app/views/govuk_publishing_components/components/_error_message.html.erb