Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

ActiveResource is not extracting errors from an XML response if the Content-Type is 'application/xml; charset=utf-8'

#3222

A change to ActiveResource::Validations was introduced in 2.3.4 which adds support for JSON errors:

http://github.com/rails/rails/commit/797588543ed70b4c5dcf51d7f1e4a7...

The following test was added to the "save_with_validation" method:

  case error.response['Content-Type']
  when 'application/xml'
    errors.from_xml(error.response.body)
  when 'application/json'
    errors.from_json(error.response.body)
  end

This is looking for an exact match on Content-Type 'application/xml'.

If, for example, the returned Content-Type is 'application/xml; charset=utf-8' then the error response is ignored.

Reported by Peter Nash · September 17th, 2009 @ 12:45 PM

State: duplicate
Milestone: none
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none