2012-01-26 1 views
2

ActiveAdmin 앱이 있습니다. 사용자가 로그인 할 때, 그것은 /admin로 이동합니다하지만 난 뭔가 다른 리디렉션을 변경하려면 /admin/custom_dashboards 내가 액세스의 리디렉션을 변경 할 수 있었다레일즈 3 ActiveAdmin. 로그인 후 리디렉션을 변경하는 방법은 무엇입니까?

application_controller.rb 
-------------------------- 
rescue_from CanCan::AccessDenied do |exception| 
    redirect_to admin_custom_dashboards_path, :alert => exception.message 
end 

와 오류를 거부하지만 내가 원하는 로그인 후 리디렉션을 변경하려면 어떻게해야합니까?

답변

2

답을 찾을 수 : Redirect to specific URL after logging in

나는 단지이

application_controller.rb 
------------------------- 
def after_sign_in_path_for(resource_or_scope) 
    admin_favorite_path # customize to your liking 
end 
을 application_controller.rb하려면 다음 추가