I\'m working on a RoR app with Devise. I want to let clients send a request to the server to see how much time is left until the user on the client is automatically logged o
Your code for time left is incorrect. The right calculation will be:
def check_time_until_logout @time_left = Devise.timeout_in.seconds - (Time.now.to_i - user_session["last_request_at"]).round end