Updating instant rails matthew davis dating sarah lancaster
How to add support for PATCH to the framework is something to be discussed. The same way the name of a static file whose contents you are "replacing" need no change. I'm not saying that PUT should issue a new URI or a resource ID.You are not forced by HTTP to delete and create database rows. I'm saying that the contents of the resource are completely replaced (not updated or patched) by a PUT.I didn't know that PATCH is available in Rails now, and as "this debate about PUT is old" I will remain silent for now ;-) The point is that Rails by default is patching the resource (update_attributes) when receiving a PUT request and doing nothing when receiving a PATCH one and that the patch will not affect anybody.I think @dlee should be working on the patch right now, shouldn't he? If you publish a REST API and your application is designed so that update actions only receive full updates, then everything is fine.Here's a clarification: @apotonick This debate about PUT is old.Before PATCH (and PATCH is very recent) there was no theoretical solution to partial updates. Obviously it doesn't make use of the textarea so on submit the form doesn't submit the text in the editor.Beceause I make use of polymorphic associations etc.
So I found this question: Using j Query to grab the content from CKEditor's iframe with some very good answers. Does somebody know why (for example) this doesn't work?
Otherwise, proxies and caches, and even clients and servers, may get confused as to the result of the operation. Furthermore, PATCH should be made the default form method when editing existing model records, since 99% of the time, users want to modify an existing record instead of replacing it.
In later versions, PUT can be deprecated or mapped to a different action with proper semantics.
So people using update_attributes for PUT are/were doing it right. On the other hand, it was up to are using update_atrributes for partial updates then it is the programmer who is not following strictly REST, not the AR method.
You are responsible for your design, and there's nothing in Rails that forces you to do partial updates. Now that there's PATCH, we (all) need to start catching up.