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
[x] - An issue already exists detailing the issue/or feature request that this PR fixes
[x] - All specs are formatted with crystal tool format spec src
[x] - 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
Purpose
Adds the
previous_url
helper as described in #1025Description
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::PageChecklist
crystal tool format spec src
./script/setup
./script/test