Skip to content

Commit

Permalink
reduce error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
ElisaRmz committed Aug 9, 2024
1 parent fddbc40 commit d6029de
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/views/shared/_error_messages.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@
<div class="alert-box danger-alert">
<div id="error_explanation" class="alert">
<h6>
<%= pluralize(resource.errors.count, "error") %> prohibited this
<%= pluralize(resource.errors.messages.count, "error") %> prohibited this
<%= @custom_error_header || resource.model_name.human %> from being saved:
</h6>

<ul>
<% resource.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% resource.errors.messages.each do |attr, error| %>
<li>
<%= "#{attr.to_s.humanize} : #{error.first}" %>
</li>
<% end %>
</ul>
</div>
Expand Down

0 comments on commit d6029de

Please sign in to comment.