In a rails application how do you efficiently display the total number of users and current number of users online?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Sam,
There are many methods for tracking online users. For example, authlogic has a
last_request_atcolumn which tracks when they last made a request to the site. Though, it’s not very efficient to run a query for that every page load. I personally use Redis for tracking that sort of activity.Here is a great example: Redis in practice, who is online
Hopefully this helps.