Just getting started with ActiveResource. If model validation fails on the server side, will ARes map the xml error messages so that <%error_messages_for :model %> will still automagically work? I''m trying to split a standard Rails app into front end vs. RESTful web service, where the actual model validations are happening in the web service, but I''m wondering how to glue back together the HTML error messages on the form. Any advice/insights? Thanks Jeff --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hey Jeff, ARes will indeed map errors from xml to local ActiveResource error objects. http://api.rubyonrails.org/classes/ActiveResource/Validations.html http://api.rubyonrails.org/classes/ActiveResource/Errors.html On your "server" application the you''ll respond with render :xml => @object.errors.to_xml which generates xml like and these will be automatically consumed by ARes. --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Feb 2, 3:41 pm, Trek <trek.glowa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey Jeff, > > ARes will indeed map errors from xml to local ActiveResource error > objects. > > http://api.rubyonrails.org/classes/ActiveResource/Validations.html > http://api.rubyonrails.org/classes/ActiveResource/Errors.html > > On your "server" application the you''ll respond with render :xml => > @object.errors.to_xml which generates xml like and these will be > automatically consumed by ARes.Thanks Trek, I''ll give it a whirl. Jeff --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org 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 -~----------~----~----~----~------~----~------~--~---