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!
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With