は、私は、WebおよびRailsの両方に新しいですし、私はコントローラの初めにこのような何かを置くための一般的な使用であることがわかった:それはだ場合なぜbefore_action:authenticate_adminを使用するのが安全ですか?
before_action :authenticate_admin, only: [:only_admin]
def authenticate_admin
unless current_user.admin?
flash[:alert] = "You are not admin!"
redirect_to '/'
end
end
を考慮するとクライアント側からこのリダイレクションを無視しても、私は本当に危険です。 redirect_to
はどのように実装されていますか?なぜこの使用法は安全性を保証できますか?