Use pluralize to properly inflect the number of errors.

This commit is contained in:
José Valim 2010-04-10 12:45:17 +02:00
parent ee309d506c
commit 944637648c
1 changed files with 1 additions and 1 deletions

View File

@ -1,7 +1,7 @@
<%%= form_for(@<%= singular_name %>) do |f| %>
<%% if @<%= singular_name %>.errors.any? %>
<div id="errorExplanation">
<h2>The following errors prohibited this form from being saved:</h2>
<h2><%%= pluralize(@<%= singular_name %>.errors.count, "error") %> prohibited this <%= singular_name %> from being saved:</h2>
<ul>
<%% @<%= singular_name %>.errors.full_messages.each do |msg| %>
<li><%%= msg %></li>