PKul
PKul

Reputation: 1711

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.

Upvotes: 1

Views: 1567

Answers (1)

chumakoff
chumakoff

Reputation: 7034

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"

Upvotes: 2

Related Questions