Action Cable, (.disappear , , , ..)
, 5 , javascript:
setInterval(function(){
var xhttp = new XMLHttpRequest();
xhttp.open("GET", "/i_am_still_here", true);
xhttp.send();
}, 5*60*1000);
..
def i_am_still_here
current_user.update(last_seen_at:DateTime.now)
end
User.rb
def is_online?
last_seen_at > 5.minutes.ago
end