Updating instant rails

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).

It says you need to send a description of how to modify the resource...

Do you have real world example of valid PATCH requests? This model method is definitely not PUT-conform in a RESTful meaning, as it doesn't replace but extends.

I'd wait green light/guidelines from someone in core before starting a patch.

can be used in combination with PUT if the client gets the full public representation of the resource, and includes that, with the desired changes, in the PUT request.

The answers posted there keep the textarea up to date. I have a textarea (rails but it just translates to a normal textarea): have you figured it out?

Furthermore, leaving the default PUT routing (alongside PATCH) in restful routes should make this change backwards compatible for most users. Reference: In most cases you are actually replacing data and not updating it.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.On submit the textarea is empty, which to me is not correct.The PUT method is already defined to overwrite a resource with a complete new body, and cannot be reused to do partial changes.

Search for updating instant rails:

updating instant rails-42updating instant rails-3updating instant rails-75

Leave a Reply

Your email address will not be published. Required fields are marked *

One thought on “updating instant rails”