Вам нужно только добавить timeoutable
к вашей модели пользователя:
devise :timeoutable
и установить интервал времени в config/initializers/devise.rb
:
# ==> Configuration for :timeoutable
# The time you want to timeout the user session without activity. After this
# time the user will be asked for credentials again. Default is 30 minutes.
config.timeout_in = 30.minutes