我有一个 iOS + Rails 3.1 应用程序,我正在使用AFIncrementalStore进行客户端-服务器通信。它是一种日历应用程序,Activity
是主要模型。
当我使用 Rails Web 表单创建新活动时,服务器会收到以下信息:
Started POST "/activities" for 127.0.0.1 at 2013-06-21 22:38:04 +0200
Processing by ActivitiesController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"pruaVLfUijjNrYfh17yJmQgYLrnrA713OjgdayudZAg=", "activity"=>{"text"=>"Test från web", "starts_at_formatted"=>"23:00"}, "commit"=>"Create Activity"}
但是当我从我的 iOS 应用程序发布时,它看起来像这样:
Started POST "/activities" for 127.0.0.1 at 2013-06-21 22:36:10 +0200
Processing by ActivitiesController#create as JSON
Parameters: {"activityID"=>"0", "auth_token"=>"xkT2eqqdoNp5y4vQy7xA", "ends_at"=>nil, "starts_at"=>"2013-06-21T22:36:10+0200", "text"=>"Inserted!", "updated_at"=>nil}
WARNING: Can't verify CSRF token authenticity
即我错过了"activity"=> {...}
包装活动数据的位。我如何实现这一点,我是否需要对representationOfAttributes
我的AFRESTClient <AFIncrementalStoreHTTPClient>
子类进行大规模检修?