首页 > Web开发 > 详细

Ruby中使用patch HTTP方法

时间:2017-04-20 20:59:03      阅读:228      评论:0      收藏:0      [点我收藏+]

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方法

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!