2009-07-23 66 views
0

我在控制器上使用before_filter :login_required,並且所有行爲都應該如此 - 未登錄的用戶會碰到會話/新建。但鑑於我在根網址上這樣做,我想避免在用戶的瀏覽器欄中實際重定向(不顯示/會話/新建)。我將如何調整?停止重定向到會話/新建?

回答

1

找到您的login_required方法定義的位置,並將redirect_to位置更改爲redirect_to root_path

如果您使用restful_authentication,我相信login_required方法定義在/lib/authenticated_system.rb