I have the following scenario: I scaffolded a resource R and in the
generated create method I have the code that responds to html and xml.
Basically by POSTing to the URI I can create entities either via forms
or via XML (where basically the tags have the same names of the
underlying model's fields)
The create method's body does this: @r = R.new(params[:r]), and it
works because Rails magically populates the params hash with the data
coming from the request (i.e., from the html form's field or from the
Now the question is: what if I want to use another format to
communicate this data?
In particular, what if I want to use an ATOM entry to tell the web app
what data I want to put into the newly created resource of type R?
In this case I would need to transfer the information contained in my
ATOM entry XML to the params has so that everything will work
What's the best way to achieve this?
Thanks and sorry if this is basic stuff.