After a successful DEVISE login, how to redirect user back to previous action that required login?

后端 未结 3 907
旧时难觅i
旧时难觅i 2021-02-05 08:21

I have an ajax voting button: If a user clicks on a \"thumbs up\" image, but is not logged in, then they should see a dialog box that asks them to login first.

To do thi

3条回答
  •  忘掉有多难
    2021-02-05 08:30

    use a cookie. Get the window.location.href that they are trying to go to and store it as a cookie. On your home page, check for the presence of this cookier in the document ready function, redirect if its there

提交回复
热议问题