I have this in Flex:
<mx:HTTPService id="update"
url="http://localhost:3000/people/{grid.selectedItem.id}.xml?_method=put"
contentType="application/xml"
resultFormat="e4x"
method="POST"
result="index.send()"/>
And when it fires I get the following error in Rails:
Processing ApplicationController#index (for 127.0.0.1 at 2009-12-07 05:33:55) [POST]
Parameters: {"person"=>{"first_name"=>"Paul", "last_name"=>"Goulart"}}
ActionController::MethodNotAllowed (Only get, put, and delete requests are allowed.):
-e:2:in `load'
-e:2
If I edit the same record using scaffolding provided by rails it works:
Processing PeopleController#update (for 127.0.0.1 at 2009-12-07 05:37:08) [PUT]
Parameters: {"commit"=>"Update", "authenticity_token"=>"MV9lFxBGxPgqP0WRTqEWa9/8D36ZzX9opk0SzJ3hUjA=", "id"=>"2", "person"=>{"first_name"=>"Paul", "address"=>"San Francisco", "last_name"=>"Goulart"}}
[4;35;1mPerson Columns (8.0ms)[0m [0mSHOW FIELDS FROM `people`[0m
[4;36;1mPerson Load (0.0ms)[0m [0;1mSELECT * FROM `people` WHERE (`people`.`id` = 2) [0m
[4;35;1mSQL (0.0ms)[0m [0mBEGIN[0m
[4;36;1mPerson Update (0.0ms)[0m [0;1mUPDATE `people` SET `first_name` = 'Paul', `updated_at` = '2009-12-07 13:37:08' WHERE `id` = 2[0m
[4;35;1mSQL (1.0ms)[0m [0mCOMMIT[0m
This should be an easy thing. Just trying to update data from flex using xml.
I'm stuck. Can anyone help?
Thanks.
Paul