Redirect to current page rails

forms, routes, ruby-on-rails

Solution

You can `redirect_to(:back)`, as long as a referrer is given. However, I'd recommend that you take a look at this answer, as the solution presented there will be resilient to things like failed logins and OAuth redirects.

Problem

I have a sign in form in my application nav bar and I was wondering if there is an easy way to have to sign_in redirect to whatever page you are currently on when you sign_in. Thanks!

Original source

Related problems