Use PATCH instead of PUT; Fixes issue #348#425
Closed
dlee wants to merge 1 commit intorails:masterfrom
Closed
Conversation
PATCH is the correct HTML verb to map to the #update action. The semantics for PATCH allows for partial updates, whereas PUT requires a complete replacement. Changes: * adds the #patch verb to routes to detect PATCH requests * adds #patch? to Request * adds the PATCH -> update mapping in the #resource(s) routes. * changes default form helpers to prefer :patch instead of :put for updates * changes documentation and comments to indicate the preference for PATCH This change tries to maintain complete backwards compatibility by keeping the original PUT -> update mapping. Users using the #resource(s) routes should not notice a change in behavior since both PUT and PATCH requests get mapped to update.
Member
|
Excellent dlee :). I'll check it out when 3.1 is branched. |
Contributor
|
Now this is a perfectly complete pull request: code, tests and docs. Love it. Bravo!! |
Contributor
Author
|
Oops, that wasn't supposed to go there. |
Contributor
|
Closed in favor of #431. |
matthewd
pushed a commit
that referenced
this pull request
Apr 24, 2018
Fix warnings from test_to_sql test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PATCH is the correct HTML verb to map to the #update action. The semantics for
PATCH allows for partial updates, whereas PUT requires a complete replacement.
Changes:
This change tries to maintain complete backwards compatibility by keeping the
original PUT -> update mapping. Users using the #resource(s) routes should not
notice a change in behavior since both PUT and PATCH requests get mapped to
update.