Skip to content

Commit

Permalink
Move error summary on edit user page outside form
Browse files Browse the repository at this point in the history
This is more consistent with what we're doing on other similar pages,
particularly ones that have been changed to use the GOV.UK Design
System, so I think this will help with subsequent changes.
  • Loading branch information
floehopper committed Nov 30, 2023
1 parent 6450c9e commit 4741a39
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions app/views/users/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,20 +40,19 @@
</p>
<% end %>

<%= form_for @user, :html => {:class => 'well add-top-margin'} do |f| %>

<% if @user.errors.count > 0 %>
<div class="govuk-error-summary alert alert-danger" aria-labelledby="error-summary-title" role="alert" tabindex="-1" data-module="error-summary">
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @user.errors.full_messages.each do |message| %>
<%= content_tag :li, message %>
<% end %>
</ul>
</div>
<% if @user.errors.count > 0 %>
<div class="govuk-error-summary alert alert-danger" aria-labelledby="error-summary-title" role="alert" tabindex="-1" data-module="error-summary">
<div class="govuk-error-summary__body">
<ul class="govuk-list govuk-error-summary__list">
<% @user.errors.full_messages.each do |message| %>
<%= content_tag :li, message %>
<% end %>
</ul>
</div>
<% end %>
</div>
<% end %>

<%= form_for @user, :html => {:class => 'well add-top-margin'} do |f| %>
<%= render partial: "form_fields", locals: { f: f } %>

<hr>
Expand Down

0 comments on commit 4741a39

Please sign in to comment.