This project is archived and is in readonly mode.
Documentation of ActiveRecord 422 errors xml
Reported by ronin-82615 (at lighthouseapp) | January 14th, 2010 @ 10:46 AM
I'm creating a active resource connection to a legacy program. I implemnted it using the 422 validation response in the documentation. There is a typo in the documentation in ActiveResource::Base under validation:
<errors type="array"><error>First cannot be empty</error></errors>
The attribute type="array" doesn't belong there. Luckily there is always code to fall back on ;) The Errors.from_xml just eats the errors when implemented as the documentation point out.
# Grabs errors from the XML response.
def from_xml(xml)
array = Array.wrap(Hash.from_xml(xml)['errors']['error']) rescue []
from_array array
end
Comments and changes to this ticket
-
Ryan Bigg June 12th, 2010 @ 03:14 AM
- State changed from new to resolved
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>