-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle PUT/DELETE through hidden input
What changed? ============= An HTML form's `method` can only be `get`, `post` or `dialog` (which we ignore). In order to send `PUT` or `DELETE` methods, form helpers (such as Phoenix's) embed a hidden input with `name="_method"` whose `value` is the operative or effective method. This commit updates our code to parse the "operative method" -- that is, the method that should take effect. By default it'll use the `form`'s method unless there's a hidden input, which will override the HTTP method we use when dispatching the request. For more, see [MDN's docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/form#method)
- Loading branch information
Showing
6 changed files
with
117 additions
and
32 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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