the activeresource encoding for xml/json seem to be
inconsistent: xml will incude the element name as root
from activeresource/base.rb
self.class.format.encode(attributes, {:root => self.class.element_name})
whereas json will use
self.class.format.encode(attributes, options)
so when an activeresource gets saved, the decoded parameters (on
the REST API side) are different, e.g.
{"city"=>nil, "name"=>"Foo Bar" } (JSON) vs.
{"person" => { "city=>nil, "name"=> "Foo Bar" } } (XML)
so when using json, i can't just use
Person.find().update_attributes(params[:person]) in my
controller.
is this intentional? looks like a bug.