diff options
author | José Valim <jose.valim@gmail.com> | 2010-04-10 11:18:20 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-10 11:18:20 +0200 |
commit | 26e05efdb6c29430c5d282870b1e236dff8465c9 (patch) | |
tree | d6b01f2b0d33f9e35c839b849b03a5aeb0d519fa /railties/lib/rails/generators/erb | |
parent | 2f79c5b48500bd2c09c401e4b55539db2afeb714 (diff) | |
download | rails-26e05efdb6c29430c5d282870b1e236dff8465c9.tar.gz rails-26e05efdb6c29430c5d282870b1e236dff8465c9.tar.bz2 rails-26e05efdb6c29430c5d282870b1e236dff8465c9.zip |
Remove error_messages_for from scaffold.
Diffstat (limited to 'railties/lib/rails/generators/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"> |