Search code examples
ruby-on-railsdeviseomniauth

How to set devise_for namespace::user


I have user model with namespace eg: app/models/v1/user.rb

I know if app/models/user.rb we can do

devise_for :user

but with namespace I don't know how to set devise_for that user object (with namespace)

devise_for 'v1/user'

rake routes ok but devise helper not work.


Solution

  • The devise_for method supports path and class_name options.

    You can do something like this:

    devise_for :users, path: 'v1/user', class_name: "V1::User"