如何在使用before_filter时更改设计的登录路径:athenticate用户?更改设计的sign_in url
我在帖子控制器中有以下内容。
如:
class PostsController < ApplicationController
before_filter :authenticate_user!
def index
@posts = Post.all
end
end
目前,它会自动进入到 '/用户/ sign_in'
我想使用 '/登录'
我认为如果你添加一个前缀斜杠(` :path =>'/'`)作为它将使用根url的路径。但我不确定,因为我对Rails 3中的路由没有信心。 – 2012-04-18 12:42:41