3

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 Answer 1

6

I found them here: 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.

Sign up to request clarification or add additional context in comments.

2 Comments

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.
You're right. I couldn't find any doc for that. Having a look at the code though, make it clear for me: bit.ly/dyXaYs . Seems that all error_messages is doing is call error_messages_for with the options received as params. Hope this helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.