ユーザー登録にDeviseを使用しており、電子メールの検証を実行するためにConfirmableを使用しています。
ユーザーが登録した後、メールを確認して送信されたリンクをクリックする必要があることを説明するURLにリダイレクトしたいと思います。Deviseの:authenticate_user!方法を使用して、ユーザーがサイトのコンテンツを表示する前にログインできるようにしています。
このファイルごとに、このリダイレクトを制御するためにafter_inactive_sign_up_path_for(resource)とを定義できるようです。after_sign_up_path_for(resource)
これが私のアプリケーションコントローラーです。
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :authenticate_user!, :except => [:after_inactive_sign_up_path_for, :after_sign_up_path_for]
def after_sign_up_path_for(user)
confirm_path
end
def after_inactive_sign_up_path_for(user)
confirm_path
end
end
しかし、それは機能しません。私が含めたようにサインインせずにアクセスできるconfirm_path私のstatic_pagesコントローラーにあります skip_before_filter :authenticate_user!
ユーザーが登録すると、:authenticate_user!ヘルパーが起動してログインページにリダイレクトします。