“谁在线”使用Devise in Rails [英] "Who's Online" using Devise in Rails

查看:102
本文介绍了“谁在线”使用Devise in Rails的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Devise on Rails,有没有办法列出目前有活动会话的所有用户,即当前登录的用户?



Ps。我正在寻找一个强大的解决方案,而不是像这个问题那样简单的解决方案

解决方案

https://github.com/ctide/devise_lastseenable



您可以使用我写的宝石来存储用户的'last_seen'时间戳。从那里开始,最近5到10分钟内显示last_seen的用户很简单。


Using Devise on Rails, is there some way to list all the users who currently have active sessions i.e. the users that are currently logged in?

Ps. I'm looking for a robust solution, not something simplistic like the ones in this question

解决方案

https://github.com/ctide/devise_lastseenable

You can use this gem that I wrote to store the 'last_seen' timestamp of a user. From there, it's pretty trivial to display the users who were last_seen in the last 5 or 10 minutes.

这篇关于“谁在线”使用Devise in Rails的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆