我创建了跨平台表单来提交数据。它以json格式发送数据,但rails控制器将其作为html响应。所以我总是会得到错误。在跨平台响应期间将json响应中的json响应更改为html响应
Object {readyState: 0, responseJSON: undefined, status: 0, statusText: "error"}
test.html?batch[status]=0:88
Navigated to file:///home/shital/workspace/shitalluitel.github.io/test.html?batch%5Bstatus%5D=0
这里是我的轨登录我的表格提交之后...
Started POST "/batches" for 127.0.0.1 at 2017-01-13 08:55:59 +0545
Processing by BatchesController#create as HTML
Parameters: {"batch"=>{"name"=>"eight", "course_id"=>"9", "start_date"=>"2016-12-12", "end_date"=>"2016-12-14", "status"=>"1"}}
User Load (0.7ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 ORDER BY "users"."id" ASC LIMIT $2 [["id", 1], ["LIMIT", 1]]
(0.2ms) BEGIN
Course Load (0.5ms) SELECT "courses".* FROM "courses" WHERE
"courses"."id" = $1 LIMIT $2 [["id", 9], ["LIMIT", 1]]
SQL (0.4ms) INSERT INTO "batches" ("name", "course_id", "start_date", "end_date", "created_at", "updated_at") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id" [["name", "eight"], ["course_id", 9], ["start_date", Mon, 12 Dec 2016], ["end_date", Wed, 14 Dec 2016], ["created_at", 2017-01-13 03:10:59 UTC], ["updated_at", 2017-01-13 03:10:59 UTC]]
(133.8ms) COMMIT
entered to true part
Completed 200 OK in 147ms (Views: 0.8ms | ActiveRecord: 135.6ms)
是什么your_response和值这里指 –
这将是你的数据在控制器响应尝试。如果有的话,你把你的数据放在那里。就像考试的结果一样,你在价值中对它进行了挖掘。 – bxorcloud
什么样的数据?如果想发送批量模型的数据,那我该怎么做?我也想检查状态? –