码迷,mamicode.com
首页 > Web开发 > 详细

Ruby中使用patch HTTP方法

时间:2017-04-20 20:57:45      阅读:215      评论:0      收藏:0      [点我收藏+]

标签:script   rect   rip   where   pat   ice   sel   roc   price   

Ruby中使用patch HTTP方法

如果使用patch,在后台可以看到只更新了改动的部分;

Started PATCH "/ads/5/update" for ::1 at 2017-04-20 20:12:40 +0800
Processing by AdsController#update as HTML
  Parameters: {"utf8"=>"?", "authenticity_token"=>"bOnqooQydWJaKHET09i/Kho52m2t
7CXgPlVgkjQW4iC2v5NZIEoBtk8Va7/sB5hDmQKhFLa/q32sTAnjtQJ1Vg==", "ad"=>{"name"=>"e
1", "description"=>"e", "price"=>"5.0", "seller_id"=>"5", "email"=>"e", "img_url
"=>"e"}, "commit"=>"Update1", "id"=>"5"}
  Ad Load (1.0ms)  SELECT  "ads".* FROM "ads" WHERE "ads"."id" = ? LIMIT ?  [["i
d", 5], ["LIMIT", 1]]
   (1.0ms)  begin transaction
  SQL (1.0ms)  UPDATE "ads" SET "name" = ?, "updated_at" = ? WHERE "ads"."id" =
?  [["name", "e1"], ["updated_at", 2017-04-20 12:12:40 UTC], ["id", 5]]
   (154.2ms)  commit transaction
Redirected to http://localhost:3000/ads/5
Completed 302 Found in 165ms (ActiveRecord: 157.2ms)

 

Ruby中使用patch HTTP方法

标签:script   rect   rip   where   pat   ice   sel   roc   price   

原文地址:http://www.cnblogs.com/stono/p/6740608.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!