Closed girardinsamuel closed 2 years ago
@josephmancuso any insights on this ? I am proposing something but I might have misunderstood the problem at first...
I guess it's the correct understanding.
I was thinking: we should be consistent with the back()
method of the response class. When using it with query params they should be present too. For this:
# response.py (no changes)
def back(self):
return self.redirect(url=self.app.make("request").get_back_path())
# request.py (some changes consistent with above)
def get_back_path(self):
return self.input("__back") or self.get_path_with_query()
Summary of all changes can be found in the PR #216
I recreate the issue in M4 to be sure we address it in M4 : https://github.com/MasoniteFramework/masonite/issues/382
Description of the issue (correct me if wrong)
When I am calling the view including
{{ back() }}
with some query parameters, those are not included inside the "back generated input".Elements to solve it
this helper use
request.get_path()
which do not contain query params.We could add to request class:
And then in the helper:
With this when visiting
http://localhost:8000/test?key=val
{{ back() }}
will generate: