Files
grecia/app/views/shared/_errors.html.erb
Javi Martín c97e7852a4 Use "excluding" instead of "reject"
This method was already available as #without, but we didn't know about
it.
2022-08-24 18:11:56 +02:00

20 lines
669 B
Plaintext

<% if resource.errors.any? %>
<div id="error_explanation" data-alert class="callout alert" data-closable>
<button class="close-button" aria-label="<%= t("application.close") %>" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
<strong>
<% errors_count = resource.errors.messages.excluding(:base).count %>
<%= pluralize errors_count, t("form.error"), t("form.errors") %>
<% if local_assigns[:message].present? %>
<%= message %>
<% else %>
<%= sanitize(t("form.not_saved", resource: t("form.#{resource.class.to_s.underscore}"))) %>
<% end %>
</strong>
</div>
<% end %>