On 26 February 2012 21:25, Bob Smith
<bsm2th-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> In my model, validation errors work properly. The problem comes when I
> try to add custom messages with self.errors.add. If I check with the
> debugger, the messages are in self.errors. A self.save runs with no
> problem. The problem comes when the controller takes over. It does a
> Model.find at the start of update and *POOF* all the messages are
> cleared. How can I display the messages and behave like the validation
> messages do ?? BTW, I''m running 2.3.9
Why are you doing another find? You must already have the model
instance that the errors are for in order to add the errors to it. If
you fetch a new record then the errors do not apply to that record.
Colin
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.