# ARes validation errors?

**URL:** <https://www.ruby-forum.com/t/ares-validation-errors/127579>\
**Category:** Rails\
**Created:** [January 30, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/ares-validation-errors/127579 "2008-01-30T15:22:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [January 30, 2008, 3:22pm UTC](https://www.ruby-forum.com/t/ares-validation-errors/127579/1 "2008-01-30T15:22:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [February 2, 2008, 10:42pm UTC](https://www.ruby-forum.com/t/ares-validation-errors/127579/2 "2008-02-02T22:42:31Z")

</div>

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/Validations.html)  
[http://api.rubyonrails.org/classes/ActiveResource/Errors.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.

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [February 4, 2008, 4:14pm UTC](https://www.ruby-forum.com/t/ares-validation-errors/127579/3 "2008-02-04T16:14:41Z")

</div>

On Feb 2, 3:41 pm, Trek [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> automatically consumed by ARes.  
> Thanks Trek, I’ll give it a whirl.

Jeff
