Ruby on rails 3 当Desive before_filter:authenticate_user工作时,如何重定向到应用程序外的特定链接

Ruby on rails 3 当Desive before_filter:authenticate_user工作时,如何重定向到应用程序外的特定链接,ruby-on-rails-3,devise,Ruby On Rails 3,Devise,这是我的分类控制器代码 class CategoriesController < ApplicationController before_filter :authenticate_user! ,:except => :index def index #some code end def show #some code end end class CategoriesControl

这是我的分类控制器代码

   class CategoriesController < ApplicationController

     before_filter :authenticate_user! ,:except => :index

     def index
       #some code
     end

     def show
       #some code
     end

   end  
class CategoriesController:索引
def索引
#一些代码
终止
def秀
#一些代码
终止
终止
很明显,你可以看到我的分类#索引页面可以公开查看,其中列出了所有分类。当任何人在未登录的情况下单击类别名称时,他/她将被重定向到“localhost:3000/users/sign_-in”

但我希望用户在设计过滤前:验证用户身份时,可以重定向到像“www.facebook.com”这样的url!工作

我怎样才能做到这一点