views:

43

answers:

1

This is a very common piece of code

<% form_for :blah... do |f| %>
<%= f.error_messages %>
First name: <%= f.text_field :first_name %><br />
....
<% end %>

error_messages is a helper method but I am having a hard time finding the documentation for it, why is that?

+1  A: 

I found them here: http://bit.ly/bAM6ss (error_messages have same params as error_messages_for).

In Rails 3 however, error_messages and error_messages_for have been deprecated and have been moved out to a plugin h ttp://bit.ly/bJEDob.

cristian
Thanks for the info but how did you know that both have the same params? That's the part that irks me, I don't see any clear reference to that effect.
Bob
You're right. I couldn't find any doc for that. Having a look at the code though, make it clear for me: http://bit.ly/dyXaYs . Seems that all error_messages is doing is call error_messages_for with the options received as params. Hope this helps.
cristian
Thanks Cristian.
Bob