2011-07-12 72 views

回答

6

執行以下操作:

在CON圖/初始化/ devise.rb:

config.warden do |manager| 
    manager.failure_app = CustomAuthenticationFailure 
    end 

創建一個新的文件名爲LIB/custom_authentication_failure.rb:

class CustomAuthenticationFailure < Devise::FailureApp 
    protected 
    def redirect_url 
     root_path #or whatever route in your app that points to '/' 
    end 
    end 

這對你的config/application.rb中:

config.autoload_paths += %W(#{config.root}/lib) 
相關問題