使用 Devise 登录或注销后,我被重定向回父应用程序 root_path,而不是我的引擎的根路径(或者,如下所示,我尝试将其指定为 home_path)。
引擎路线:
MyEngine::Engine.routes.draw do
devise_for :users, {
:class_name => "MyEngine::User",
:module => :devise
}
get '/' => 'home#index', as: :home
root :to => 'home#index'
end
引擎应用控制器:
module MyEngine
class ApplicationController < ActionController::Base
def after_sign_in_path_for(resource)
home_path
end
end
end
谢谢...