Rails 使用 Devise 显示在线用户 [英] Rails Using Devise to show Online users

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

问题描述

我想在 Who's online 模块中向我的在线用户展示.

I would like to show my online users in a Who's online module.

我正在使用 Devise 来管理我的用户.

I'm using Devise to manage my users.

我到处搜索,但我不知道如何管理它.

I searched everywhere, but I don't have any idea to manage it.

你有线索吗?

提前致谢

推荐答案

当有人登录时,你可以将他推入一个数组,如果有人退出,只需将他从数组中删除.所以你可以循环数组项来显示在线用户.希望对你有用.对不起,我的英语不好.

when someone has logged in, you can push him into an array, if someone has logged out, just remove him from the array. So you can loop the array items to show the online users. Hope it is useful to you. Sorry for my poor english.

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

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