devise关于model的问题,和跳转路径的问题
关于model的问题
1.比如我现在创建一个model(user).
rails g devise backend/user
然后的话我如果在controller中在backend/application_controller.rb
添加下面的代码
before_action :authenticate_backend_user!
接下来就跳错了
关于跳转路径的问题
2.假设我现在已经能够进行登陆了,但是我现在controller中有这个目录
- backend
它是专门放后台的controller的.但是我现在想让devsie登陆成功后跳转到后台的首页
,而不是root页面
路径跳转你可你参考 https://github.com/plataformatec/devise/wiki/How-To:-redirect-to-a-specific-page-on-successful-sign_in,-sign_out,-and-or-sign_up