开发者

devise remember_me value

开发者 https://www.devze.com 2023-04-03 12:31 出处:网络
I am using devise in my application. When a user goes to my website, if i know that the user had previously visited my website and checked \'Remember Me\' while logging in, I want to show ihm a specia

I am using devise in my application. When a user goes to my website, if i know that the user had previously visited my website and checked 'Remember Me' while logging in, I want to show ihm a special message. How I do ge开发者_运维知识库t this remember me value from devise in my view? Thanks.


If you have a saved user and wants to know whereas he clicked on the remember_me use the field:

@user.remember_created_at

If you have a instantiated user in your controller after the form submission, you can access the value using:

@user.remember_me

remember_me is a attr_accessor in Devise gem, see here. Which means it will not be persisted when saving you user's instance.

0

精彩评论

暂无评论...
验证码 换一张
取 消