Updating instant rails adam levine dating who
This is true, but unless you control both the server and client code, there's no way to enforce this.
The problem is that should be set to nil (or, it is't invalid to let age be nil, the entire change should be rejected with an appropriate status code and explanatory message).
I can't make a onsubmit function to get the value of the textarea (when the form is submitted) .
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?
I was subscribed for a while to the REST mailing list and saw big names discussing about it. If you need to, be pragmatic and use something, for example PUT.
Not pure, but there's no pure solution (other than definining ad-hoc resources and do proper PUTs to them).
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.
Beceause I make use of polymorphic associations etc.
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.
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.