[英]Rails - Devise Gem remove Sign up and Forgot Password modules
I work Rails 4
with Devise
gem for User authentication, In my project also working fine with Devise
gem. 我使用
Devise
gem工作Rails 4
进行用户身份验证,在我的项目中也可以正常使用Devise
gem。 But I want to remove the features of Sign up
and Forgot Password
modules. 但我想删除
Sign up
和Forgot Password
模块的功能。
For removing sign_up
, In config/routes.rb
file using skip
option like, 要删除
sign_up
,请使用skip
选项在config/routes.rb
文件中,
devise :users, :skip => :registration
It removes the sign_up module also truncated path generation
. 它删除了sign_up模块也截断了
path generation
。 This is fine. 这可以。
But the same way, if I include this option for Forgot password
但同样的方法,如果我为
Forgot password
包含此选项
devise :users, :skip => :recover
or
devise :users, :skip => :recoverable
it won't work. 它不会起作用。 I need to hide both modules in the same way of method.
我需要以相同的方法隐藏两个模块。
How to achieve this? 怎么做到这一点? Thanks in advance..
提前致谢..
I got the answer, 我得到了答案,
In Devise model
class remove the devise :registerable, :recoverable
option. 在Devise
model
类中删除devise :registerable, :recoverable
选项。
Also do the changes in devise/shared/_link.html.erb
by deleting the path generation
links of sign_up and forgot_password
还可以通过删除
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.