development.log extract ...
Processing ClientsController#create (for 192.168.2.101 at 2008-01-14
19:58:17) [POST]
Session ID: 2258f3de2b013ddc9c46d861d917466a
Parameters: {"waypoints"=>"wp",
"action"=>"create",
"landtitle"=>"blah",
"controller"=>"clients",
"owner"=>"petem"}
^[[4;36;1mSQL (0.000298)^[[0m ^[[0;1mSET SQL_AUTO_IS_NULL=0^[[0m
^[[4;35;1mClient Columns (0.046731)^[[0m ^[[0mSHOW FIELDS FROM
clients^[[0m
^[[4;36;1mSQL (0.000417)^[[0m ^[[0;1mBEGIN^[[0m
^[[4;35;1mSQL (0.000529)^[[0m ^[[0mINSERT INTO clients
(`waypoints`, `landtitle`, `owner`) VALUES(NULL, NULL, NULL)^[[0m
^[[4;36;1mSQL (0.012764)^[[0m ^[[0;1mCOMMIT^[[0m
Redirected to http://www.wombatdreaming.com:3000/clients/60
Completed in 0.11676 (8 reqs/sec) | DB: 0.06074 (52%) | 302 Found
[http://www.wombatdreaming.com/clients]
I''m getting the behaviour above when I setup a simple little one table
example (clients) and attempt to POST a HTTPRequest with this
program ....
use LWP::UserAgent;
use URI::URL;
$hdrs = HTTP::Headers->new(Accept => ''text/html'',
User-Agent =>
''MegaBrowser/1.0'');
$url =
URI::URL->new(''http://www.wombatdreaming.com:3000/clients'');
$req = HTTP::Request->new(POST, $url, $hdrs,
"owner=petem&landtitle=blah&waypoints=wp");
$ua = LWP::UserAgent->new();
$resp = $ua->request($req);
if ($resp->is_success) {
print $resp->content;
} else {
print $resp->message;
}
The parameters are being recognised but are NULLS trying to be
inserted into the (string) fields? why? Now how do I debug this? Where
can I see what the ActiveRecord base class is doing this for me? Or am
I just drivng the request wrongly?
Thanks if you can help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---