Fix request.path inside with_request_url helper#1463
Merged
joelhawksley merged 2 commits intoViewComponent:mainfrom Aug 10, 2022
Merged
Fix request.path inside with_request_url helper#1463joelhawksley merged 2 commits intoViewComponent:mainfrom
joelhawksley merged 2 commits intoViewComponent:mainfrom
Conversation
`#with_request_url` is great. It was started in ViewComponent#1058, but later ViewComponent#1221 introduced a tiny regression in the parsing of segments. When using `#with_request_url` including a query string, the `#path` helper would now contain the query string segment, when it should not. This led to `#fullpath` having the query string twice. This commit fixes the parsing and amends the test cases to cover this scenario.
Contributor
Author
|
If I see things correctly, the failing build seems to also happen in |
joelhawksley
approved these changes
Aug 10, 2022
Member
joelhawksley
left a comment
There was a problem hiding this comment.
Thank you for your wonderful contribution! ❤️
claudiob
pushed a commit
to claudiob/view_component
that referenced
this pull request
Dec 22, 2023
* Fix request.path inside with_request_url helper `#with_request_url` is great. It was started in ViewComponent#1058, but later ViewComponent#1221 introduced a tiny regression in the parsing of segments. When using `#with_request_url` including a query string, the `#path` helper would now contain the query string segment, when it should not. This led to `#fullpath` having the query string twice. This commit fixes the parsing and amends the test cases to cover this scenario. * Apply suggestions from code review Co-authored-by: Joel Hawksley <joelhawksley@github.com>
claudiob
pushed a commit
to claudiob/view_component
that referenced
this pull request
Jan 3, 2024
* Fix request.path inside with_request_url helper `#with_request_url` is great. It was started in ViewComponent#1058, but later ViewComponent#1221 introduced a tiny regression in the parsing of segments. When using `#with_request_url` including a query string, the `#path` helper would now contain the query string segment, when it should not. This led to `#fullpath` having the query string twice. This commit fixes the parsing and amends the test cases to cover this scenario. * Apply suggestions from code review Co-authored-by: Joel Hawksley <joelhawksley@github.com>
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.
What are you trying to accomplish?
#with_request_urlis great. It was started in #1058, but later #1221introduced a tiny regression in the parsing of segments.
When using
#with_request_urlincluding a query string, the#pathhelper would now contain the query string segment, when it should not.
This led to
#fullpathhaving the query string twice.What approach did you choose and why?
I added regression tests to the existing scenarios and then fixed the parsing to make them pass. :)
Anything you want to highlight for special attention from reviewers?
I love this library. 😍