views:

78

answers:

2

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

I'm using Devise to manage my users.

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

Do you have a clue?

Thanks in advance

+1  A: 

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.

VvDPzZ
A: 

I don't know if it really works, but you can try:

users = User.find(:all, :conditions => ["current_sign_in_ip <> '' "])

You can test the current_sign_in_ip or current_sign_in_at attributes to know what works better for your needs.

Victor Hugo