You dont want to pass the whole f object( the form helper object), when you
only need the AR instance to loop the object's validation errors. f has
methods of its out like text_field , check_box, etc...  you dont want to
pass f to generate the error list when the instance of the AR is the one
with has the method errors. In your example @user is the same as f.object so
you could have done


<%= render 'shared/error_messages', :object=> @user %>

This makes clear what is it that you are passing to the errors loop. AR
instances have a method like this

@user.errors

so you can do

@user.errors.each do

on the other hand , f is a form helper object, that has methods like

f.text_field
f.text_area

I hope this helps.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to