使用 before_filter :authenticate 用户时如何更改设备的登录路径?
我在帖子控制器中有以下内容。
eg:
class PostsController < ApplicationController
before_filter :authenticate_user!
def index
@posts = Post.all
end
end
目前它会自动转到“/users/sign_in”
我想使用“/login”
现在,使用 devise_for 方法对大家进行排序。
devise_for :users, :controllers => { :registrations => 'registrations' }, :path => 'accounts', :path_names => { :sign_in => 'login', :sign_up => 'new', :sign_out => 'logout', :password => 'secret', :confirmation => 'verification' }
所以现在sign_in路径是'accounts/login'
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)