luckyframework / lucky

A full-featured Crystal web framework that catches bugs for you, runs incredibly fast, and helps you write code that lasts.
https://luckyframework.org
MIT License
2.57k stars 156 forks source link

Adds previous_url method to url_helpers #1641

Closed colinkey closed 2 years ago

colinkey commented 2 years ago

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