Skip to content

Commit

Permalink
Merge pull request #265 from hanami/redirect_to_back
Browse files Browse the repository at this point in the history
Redirect to back commented
  • Loading branch information
AlfonsoUceda committed Jan 22, 2017
2 parents dd35fae + b48a8c6 commit 40efc36
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions source/guides/actions/control-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,12 @@ module Web::Controllers::Dashboard
end
end
```

### Back

Sometimes you'll want to `redirect_to` back in your browser's history so the easy way to do it
is the following way:

```ruby
redirect_to request.headers["Referer"] || fallback_url
```

0 comments on commit 40efc36

Please sign in to comment.