← Back to Upcase

Devise sign_in path

(Scott Hollinshead) #1

Hi

How do I change my admins/sign_in path to /admin in devise?

My current routes file is this, there will be a user model also, which is why I am specifying the admins/sessions controller.

devise_for :admins, controllers: {sessions: 'admins/sessions'}

Thanks

0 Likes

(Luís Ferreira) #3

Have you tried:

devise_for :admins, :path => '', :path_names => {:sign_in => 'admins'}

You can check it out on devise’s documentation.

0 Likes

(Scott Hollinshead) #4

Thanks guys, this is what I did to get it working:

  devise_for :admins, controllers: {sessions: 'admins/sessions'},
    path: '', path_names: {sign_in: 'admin'}
2 Likes