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 | |
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')
-rw-r--r-- | railties/lib/rails/generators/erb/scaffold/templates/_form.html.erb | 11 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css | 11 |
2 files changed, 13 insertions, 9 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"> diff --git a/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css b/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css index ea3dc9b8b5..f3f46d8b98 100644 --- a/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css +++ b/railties/lib/rails/generators/rails/stylesheets/templates/scaffold.css @@ -35,10 +35,10 @@ div.field, div.actions { } #errorExplanation { - width: 400px; + width: 450px; border: 2px solid red; padding: 7px; - padding-bottom: 12px; + padding-bottom: 0; margin-bottom: 20px; background-color: #f0f0f0; } @@ -49,16 +49,11 @@ div.field, div.actions { padding: 5px 5px 5px 15px; font-size: 12px; margin: -7px; + margin-bottom: 0px; background-color: #c00; color: #fff; } -#errorExplanation p { - color: #333; - margin-bottom: 0; - padding: 5px; -} - #errorExplanation ul li { font-size: 12px; list-style: square; |