[英]Rails - Devise Gem remove Sign up and Forgot Password modules
我使用Devise
gem工作Rails 4
进行用户身份验证,在我的项目中也可以正常使用Devise
gem。 但我想删除Sign up
和Forgot Password
模块的功能。
要删除sign_up
,请使用skip
选项在config/routes.rb
文件中,
devise :users, :skip => :registration
它删除了sign_up模块也截断了path generation
。 这可以。
但同样的方法,如果我为Forgot password
包含此选项
devise :users, :skip => :recover
or
devise :users, :skip => :recoverable
它不会起作用。 我需要以相同的方法隐藏两个模块。
怎么做到这一点? 提前致谢..
我得到了答案,
在Devise model
类中删除devise :registerable, :recoverable
选项。
还可以通过删除sign_up and forgot_password
的path generation
链接来进行sign_up and forgot_password
devise/shared/_link.html.erb
的更改
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.