Skip to content

Commit

Permalink
Add instructions for default redirect status (#1263)
Browse files Browse the repository at this point in the history
* Add docs for the new inline_svg macro

* Remove SVG builder from awesome page

* chore: add instructions to configure the redirect status globally
  • Loading branch information
wout authored Oct 29, 2023
1 parent d59f714 commit ddcbeed
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/actions/guides/http_and_routing/request_and_response.cr
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@ class Guides::HttpAndRouting::RequestAndResponse < GuideAction
The default status for a redirect is `HTTP::Status::FOUND` (302), but if you need a different status code, you can pass any [HTTP Status Enum](https://crystal-lang.org/api/HTTP/Status.html).
Alternatively, the default status value can also be configured globally:
```crystal
# config/server.cr
Lucky::Redirectable.configure do |settings|
settings.redirect_status = HTTP::Status::SEE_OTHER.value
end
```
### Redirect back
`redirect_back` allows an action to send the user back to where they made the request from. This is really useful in situations like submitting
Expand Down

0 comments on commit ddcbeed

Please sign in to comment.