I figured it out by poking through the ActiveController::Base source.
To make this work, you have to specify "Content-type: application/xml"
in the HTTP PUT request. This triggers logic set up by default in the
ActionController::Base.param_parsers hash to parse the XML and put it
in the params hash for the REST controller to use.
MLM
On Feb 8, 2:34 pm, "Mark Murphy"
<mmurphy...-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>
wrote:> I''m attempting to create a RESTful Web service using 1.2.2. I
would
> like to be able to update a model via an XML payload PUT to the
> controller, but the scaffold_resource PUT handler
> (MyController#update) seems to only work with values of the form
> "modelname[columname]=value". If I supply anything else -- such
as the
> same XML that the scaffolded GET returns -- it gets ignored by the
> controller.
>
> I''m guessing that I need to roll my own #update, which is fine.
How
> can I get my hands on the raw data sent over by the PUT invocation? Or
> is there a better way of accomplishing this?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---