Rails handles the 99% case: it is unlikely that you will ever need to do any XML or JSON translations in your Edit action, because not visually the Edit action is very similar to the Show action. Non-visual clients who want to update the model in their application can invoke the controller this way.
GET /my_models/[:id].xml (Show)
Then the client application can make any transformations or changes and publish (or put) the results in
PUT /my_models/[:id].xml (Update)
When you call this, you usually do this to get an editable form of the Show action:
GET /my_models/[:id]/edit
And it is intended for human use. 99% of the time, that is. Since this is unusual for transforming data into an βEditβ action, Rails assumes that you do not, and SUBMITS your code, leaving response_to on the scaffold.
Pete
source share