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.
This PR is a follow-up of the proposal on the Elixir Forum: Proposal for Phoenix: add HTTP verb to VerifiedRoutes.
tldr; I propose to add a way for VerifiedRoutes to know if they’re used for get, post, etc to make them even more robust, and safer to refactor. This solution could be to add a “tag” to verified routes, like so:
~p"/user/#{user}"get
. More context and details can be found on the original post.Please tell me what you think about this proposition. The code in the PR is functional, although I'd rather have more people re-read the test cases carefully to ensure the behaviour is the one expected. Also, I didn't update the documentation yet.
Here's the behaviour I expected to introduce (this is a copy-paste of the "add tests explaining behaviour" commit description):
PS: I know the proposal wasn't validated or anything, but I figured this wouldn't take me too long to make a POC anyway, so I don't mind reworking the solution if this one isn't the one we ought to keep for any reason.