|
Hi. I'm building a Flash app that connects to mySQL. I've never done web scripting before, but I picked up enough PHP to do what I need pretty quickly. (Right now, I'm using php.serialize to pass into/out of Flash).
I recently heard about Rails, and though I'd give it a try. I created the library app per this tutorial and a basic Flash frontend tro test. When I POST to localhost:3000/books with xml.sendAndLoad in Flash, it keeps creating empty records. I tried using CURL as per your tutorial, and it worked fine.
Here is my log from CURL:
Processing BookController#collection (for 127.0.0.1 at 2006-04-22 15:22:20) [POST]
Session ID: 610946147ef5047edb648e39e0f8741a
Parameters: {"action"=>"collection", "controller"=>"book", "book"=>{"title"=>"losers", "description"=>"never win."}}
[4;36;1mBook Load (0.000000)[0m [0;1mSELECT * FROM books [0m
[4;35;1mBook Columns (0.016000)[0m [0mSHOW FIELDS FROM books[0m
[4;36;1mSQL (0.000000)[0m [0;1mBEGIN[0m
[4;35;1mSQL (0.015000)[0m [0mINSERT INTO books (`title`, `description`) VALUES('losers', 'never win.')[0m
[4;36;1mSQL (0.000000)[0m [0;1mCOMMIT[0m
Redirected to http://localhost:3000/book/by_id/8
Completed in 0.04700 (21 reqs/sec) | DB: 0.03100 (65%) | 201 Created [http://localhost/books/]
And from Flash:
Processing BookController#collection (for 127.0.0.1 at 2006-04-22 15:27:16) [POST]
Session ID: 7136b9261bffc44afad273ece4984952
Parameters: {"action"=>"collection", "<book><title>a title</title><description>a description</description></book>"=>"", "controller"=>"book"}
[4;35;1mBook Load (0.000000)[0m [0mSELECT * FROM books [0m
[4;36;1mBook Columns (0.031000)[0m [0;1mSHOW FIELDS FROM books[0m
[4;35;1mSQL (0.000000)[0m [0mBEGIN[0m
[4;36;1mSQL (0.000000)[0m [0;1mINSERT INTO books (`title`, `description`) VALUES('', NULL)[0m
[4;35;1mSQL (0.000000)[0m [0mCOMMIT[0m
Redirected to http://localhost:3000/book/by_id/9
Completed in 0.29700 (3 reqs/sec) | DB: 0.03100 (10%) | 201 Created [http://localhost/books/]
Do you know what would cause the script to recognize the XML from CURL but not from Flash? Any reccommendations? Is it worth doing this in RoR/XML rather than PHP/Serialize?
Thanks much!
|