當管理員登錄時,它會自動重定向到主主頁(即不是管理控制檯)。我不知道爲什麼它這個還是怎麼改...登錄後激活管理員重定向
的routes.rb
ActiveAdmin.routes(self)
devise_for :admin_user, ActiveAdmin::Devise.config
get "guidelines/topic"
get "guidelines/topichospital"
get "guidelines/topicspecialty"
get "guidelines/favourite"
get "profiles/show"
get "guidelines/show"
root :to => 'guidelines#index'
我application_controller.rb已更改用戶登錄後重定向(但不應該是管理員登錄) - 這是問題嗎?
include PublicActivity::StoreController
protect_from_forgery
def after_sign_in_path_for(resource)
favourites_path
end
hide_action :current_user
什麼在你的控制器裏放置了'login'動作?已從應用程序控制器添加了 – Zippie 2013-03-13 01:06:03
- 是嗎?在'def after_sign_in_path_for'方法中使用devise – tessad 2013-03-13 01:11:26
,您應該寫入,而不是'favourites_path'您希望它重定向到。我從來沒有使用過設計,所以我不確定這是否正確,但嘗試用'admin_root_path'替換'favourites_path'。使用耙路徑查看所有路線,然後在方法 – Zippie 2013-03-13 01:17:48