ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
app/views/errors/_error_summary.html.haml

Summary

Maintainability
Test Coverage
- if ep.errors.any?
  .govuk-error-summary{ role: 'group', 'aria-labelledby': 'error-summary-heading', tabindex:'-1' }
    %h2.govuk-heading-m.govuk-error-summary__title{id: 'error-summary-heading'}
      = error_summary
      = pluralize(ep.errors.count , t('shared.errors.error'))

    %span.form-hint
      = t('shared.errors.form_error_hint')

    .govuk-error-summary__body
      %ul.govuk-list.govuk-error-summary__list
        - ep.errors.each do |error|
          %li
            = link_to ['#', error.attribute].join do
              = ep.errors.full_message(error.attribute, error.message)