Monday, August 29, 2011

Re: [Rails] Re: Error with errors

On 29 August 2011 12:54, Neil Bye <lists@ruby-forum.com> wrote:
> I now have <%= User.new.errors.full_messages %> in my view and this

A new User object's errors are going to be empty unless validation has
been run (with .valid? or .save, etc).

Going back to your original problem (I've just looked up your first
message), you seem to be trying to add .errors to a model inheriting
from ActiveRecord::Base - but that already *has* a .errors method. So
your problem is likely to be elsewhere.

In the view that's not working, before you conditionally check for
errors, can you inspect the error object, and see what it is. Also,
have you tried using the "standard" error_messages_for method - just
to check?

M

--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate