Devise within namespace

后端 未结 6 562
慢半拍i
慢半拍i 2021-01-30 03:22

I\'m trying to split my rails project in a front-end for regular users and a back-end for admins. Therefore i have created a namespace \'admin\' so that i can easily control adm

6条回答
  •  野的像风
    2021-01-30 03:57

    How about just moving the devise_for method into a scope:

    scope '/admin' do
      devise_for :admins
    end
    

    With namespace, the controllers will try to look for an Admin::SessionController that wont exist. With scope it doesn't, so that should work.

提交回复
热议问题