Rails: Best practice for displaying ActiveRecord validation error in XML Builder?
- by randombits
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?