diff options
Diffstat (limited to 'railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb')
-rw-r--r-- | railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb index 01ec58c615..b0222b24e4 100644 --- a/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb +++ b/railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb @@ -1,5 +1,14 @@ <%%= form_for(@<%= singular_name %>) do |f| %> - <%%= f.error_messages %> + <%% if @<%= singular_name %>.errors.any? %> + <div id="errorExplanation"> + <h2>The following errors prohibited this form from being saved:</h2> + <ul> + <%% @<%= singular_name %>.errors.full_messages.each do |msg| %> + <li><%%= msg %></li> + <%% end %> + </ul> + </div> + <%% end %> <% for attribute in attributes -%> <div class="field"> |