4 ms·
http://tools.ietf.org/html/rfc5789 http://tools.ietf.org/html/rfc5789 HTTP PUT is for in place entire entity updates. HTTP PATCH is for partial updates. This
by peregrine 14y ago
http://tools.ietf.org/html/rfc5789 http://tools.ietf.org/html/rfc5789
HTTP PUT is for in place entire entity updates.
HTTP PATCH is for partial updates.
This isn't some opinion these guys came up with. It's HTTP standards.
Also if you don't like what save does. Write your own Backbone.sync and be done with it. Still super flexible.
- MatthewPhillips 14y agoFair enough, I agree with the spec here, but we know that in the wild many companies don't conform to HTTP.
- jmorton 14y agoFor what it's worth... "PATCH is going to be the primary method for updates in Rails 4.0." http://weblog.rubyonrails.org/2012/2/25/edge-rails-patch-is-the-new-primary-http-method-for-updates/ http://weblog.rubyonrails.org/2012/2/25/edge-rails-patch-is-... That's not intended to be a counterpoint. In the wild, many companies don't use Rails. :)
- k3n 14y agoIt doesn't matter what Rails decides to do if your HTTP server doesn't support it. With that said, it looks like many do already support it (from the same article you linked): Apache, nginx, Phusion Passenger, Unicorn, Thin, and WEBrick.
- steveklabnik 14y agoAlso, Rails supports an override as well, so you can send it as a POST but specify a different verb in a header, and it will treat it as a native request with the correct verb.