Rails: Best practice for displaying ActiveRecord validation error in XML Builder?
Posted
by randombits
on Stack Overflow
See other posts from Stack Overflow
or by randombits
Published on 2010-04-17T20:11:31Z
Indexed on
2010/04/17
20:13 UTC
Read the original article
Hit count: 210
I'm building a RESTful API using Ruby on Rails. My models have a lot of validation happening in them. I'm wondering what is the most "RESTful" way to respond to a user in the event that they make a request that fails on the model layer.
Sending a 4xx HTTP response is the first step. What's the best practice for embedding the error messages inside of XML builder?
© Stack Overflow or respective owner