首页 > 代码库 > Ruby中使用patch HTTP方法
Ruby中使用patch HTTP方法
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方法
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。