iphone - How to POST from Restkit + iOS to Rails -
my rails app has post model "name" property. i'm trying create new post ios using restkit. here's ios code.
nsdictionary* params = [nsdictionary dictionarywithobject:@"amazingname" forkey:@"name"]; [[rkclient sharedclient] post:@"/posts" params:params delegate:self];
and here's server log running on same machine
started post "/posts" 127.0.0.1 @ tue may 10 15:39:14 -0700 2011 processing postscontroller#create json parameters: {"name"=>"amazingname"} mongodb blog_development['posts'].insert([{"_id"=>bson::objectid('4dc9be92be2eec614a000002')}]) completed 406 not acceptable in 4ms
as can see, server gets request, name doesn't saved db. nameless post gets created. wrong ios code?
it works when switch forkey:@"name" forkey:@"post[name]"
Comments
Post a Comment