At some point when creating a Flex application you will want to update an item in the database using Rails(e.g. the details about a film).
To update a resource using REST you need to use the HTTP verb PUT, so the code below should work if we’re updating a film with ID=1:
<mx:HTTPService id="UpdateFilm" method="PUT" url="films/1.xml" useProxy="false" ... </mx:HTTPService>
The manual states if useProxy=”false” you can only use GET or POST. Not particularly good if you want to get some rest in:-)
Luckily Rails has a work around for this, which is the detection of a _method parameter on the end of a URL. For example:
<mx:HTTPService id="UpdateFilm"
method="POST"
url="films/1.xml?_method=PUT
....
</mx:HTTPService>
SubReview was developed using Ruby on Rails v2, Flex and Yahoo YUI.
The software design behind the scenes is roughly based on a REST based architecture. If you’ve never heard of REST before then this site has a good explanation about it.
Some of the REST resources on this site are:
Latest Film reviews |
---|
Daisy (데이지) |
Casshern (キャシャーン) |
SPL, Sha Po Lang (殺破狼) |
Sky Blue (원더풀 데이즈) |
R-Point (알 포인트) |
Latest Gadget reviews |
---|
Powerbar |
Philips Sonicare B400 Series (HX6431/46) |
FlashSticks |
Nokia N76 |
Sony W880i |
Latest Game reviews |
---|
F1 2009 (Wii) (F1 2009) |
Resident Evil 4 (Wii Version) |
Latest Articles |
---|
OpenID now enabled by sub1 (06/05) |
Why is GTA IV not on the Wii? by nicos (12/04) |
Capistrano Nginx Mongrel VHost by sub1 (04/04) |
Flex HTTPService PUT method problem by sub1 (19/03) |
SubReview development by sub1 (17/03) |
Welcome by sub1 (11/03) |