diff options
Diffstat (limited to 'railties/guides')
-rw-r--r-- | railties/guides/source/getting_started.textile | 11 |
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 /> |