aboutsummaryrefslogtreecommitdiffstats
path: root/railties/guides/source/getting_started.textile
diff options
context:
space:
mode:
authorRohit Arondekar <rohit.arondekar@gmail.com>2010-04-20 23:23:32 -0700
committerRohit Arondekar <rohit.arondekar@gmail.com>2010-04-20 23:23:32 -0700
commit606bed1a77e0a0a2baf81d1866c66100de443701 (patch)
tree6610aef1492c99a4cfe20995162f37563b422c10 /railties/guides/source/getting_started.textile
parentadda7516e91943f940136cbfe0a0a0b89b65fb82 (diff)
downloadrails-606bed1a77e0a0a2baf81d1866c66100de443701.tar.gz
rails-606bed1a77e0a0a2baf81d1866c66100de443701.tar.bz2
rails-606bed1a77e0a0a2baf81d1866c66100de443701.zip
Replaced f.error_messages with the new code as generated by rails 3 b3
Diffstat (limited to 'railties/guides/source/getting_started.textile')
-rw-r--r--railties/guides/source/getting_started.textile11
1 files changed, 10 insertions, 1 deletions
diff --git a/railties/guides/source/getting_started.textile b/railties/guides/source/getting_started.textile
index c33d50d055..8538d38374 100644
--- a/railties/guides/source/getting_started.textile
+++ b/railties/guides/source/getting_started.textile
@@ -603,7 +603,16 @@ If you take a look at +views/posts/_form.html.erb+ file, you will see the follow
<erb>
<%= form_for(@post) do |f| %>
- <%= f.error_messages %>
+ <% if @post.errors.any? %>
+ <div id="errorExplanation">
+ <h2><%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:</h2>
+ <ul>
+ <% @post.errors.full_messages.each do |msg| %>
+ <li><%= msg %></li>
+ <% end %>
+ </ul>
+ </div>
+ <% end %>
<div class="field">
<%= f.label :name %><br />