force user to login before action devise rails code example Example: force user to login before action devise rails before_action :authenticate_user!