Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds previous_url method to url_helpers #1641

Merged
merged 3 commits into from
Jan 6, 2022
Merged

Adds previous_url method to url_helpers #1641

merged 3 commits into from
Jan 6, 2022

Conversation

colinkey
Copy link
Contributor

@colinkey colinkey commented Jan 6, 2022

Purpose

Adds the previous_url helper as described in #1025

Description

If the Referer header is set, this method should return the url from the header. A user should pass a Lucky::Action or Lucky::RouteHelper as a fallback in instances where the Referer header is not set.

Functionally, it works very similar to the redirect_back method added in #1168 but is suitable to use within a Lucky::Page

Checklist

  • - An issue already exists detailing the issue/or feature request that this PR fixes
  • - All specs are formatted with crystal tool format spec src
  • - Inline documentation has been added and/or updated
  • - Lucky builds on docker with ./script/setup
  • - All builds and specs pass on docker with ./script/test

Copy link
Member

@matthewmcgarvey matthewmcgarvey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work 🎉

@matthewmcgarvey matthewmcgarvey linked an issue Jan 6, 2022 that may be closed by this pull request
Copy link
Member

@jwoertink jwoertink left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙌 perfect! Thanks so much for contributing 😄

@jwoertink jwoertink merged commit f07fb81 into luckyframework:master Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add 'previous_url' helper
3 participants