0
class UserSessionsController < ApplicationController
skip_before_action :require_login, except: [:destroy]
def new
...
end
def create
...
end
def destroy
logout
redirect_to signin_path , flash: { info: 'Bye!' }
end
end
class ApplicationController < ActionController::Base
before_action :require_login
private
def not_authenticated
redirect_to signin_path, flash: { danger: "ALARM!" }
end
end
私がログアウトすると、フラッシュメッセージ "ALARM"でサインインページにリダイレクトされます。 その後、もう一度ログインすると、「Bye!」というフラッシュメッセージでサインインページにリダイレクトされます。Session#destroy not_authenticatedアクションがトリガーされるのはなぜですか?
お願いします。