From 606bed1a77e0a0a2baf81d1866c66100de443701 Mon Sep 17 00:00:00 2001 From: Rohit Arondekar Date: Tue, 20 Apr 2010 23:23:32 -0700 Subject: Replaced f.error_messages with the new code as generated by rails 3 b3 --- railties/guides/source/getting_started.textile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'railties/guides/source') 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 <%= form_for(@post) do |f| %> - <%= f.error_messages %> + <% if @post.errors.any? %> +
+

<%= pluralize(@post.errors.count, "error") %> prohibited this post from being saved:

+
    + <% @post.errors.full_messages.each do |msg| %> +
  • <%= msg %>
  • + <% end %> +
+
+ <% end %>
<%= f.label :name %>
-- cgit v1.2.3