Skip to content
Browse files

Replaced f.error_messages with the new code as generated by rails 3 b3

  • Loading branch information...
1 parent adda751 commit 606bed1a77e0a0a2baf81d1866c66100de443701 @rohit rohit committed
Showing with 10 additions and 1 deletion.
  1. +10 −1 railties/guides/source/getting_started.textile
View
11 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 />

0 comments on commit 606bed1

Please sign in to comment.
Something went wrong with that request. Please try again.