I am following this guide I have User model.
In ApplicationController:
after_filter :user_activity
private
def user_activity
current_user.try :touch
end
In User model:
def online?
updated_at > 10.minutes.ago
end
How can I access all users that are online? I tried in view:
<%= user.online? %>
I got this error:
undefined local variable or method `user'
Some tips ?
Thanks in advance.