The way Devise does this (in broad terms) is that on any page where you check for authentication (before_action :authenticate_user!) that method first checks to see if you are already signed in, if not, it stores the location of the page where you are in a cookie, then redirects you to the new session path, if you are successful in authenticating, then the session create method removes your original destination from the cookie, and redirects you there.
Walter > On Jul 9, 2017, at 5:59 AM, eben sinaga <[email protected]> wrote: > > I don't use devise > > On Sunday, 9 July 2017 14:08:08 UTC+7, Robert O'Connor wrote: > If you use something like devise.. it's more or less done for you. > > On Jul 9, 2017 3:03 AM, "eben sinaga" <[email protected]> wrote: > Hi, > > I have one questions, how to stay on page after login ? should i create > session url or something else ? > > Cheers > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/de87baad-9125-48f8-9abd-8031b133e20c%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/rubyonrails-talk/6e81c04d-1d2d-4051-aea3-4595e46d752a%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/C3540F09-9533-46C8-9194-186E94F6027F%40wdstudio.com. For more options, visit https://groups.google.com/d/optout.

