I have a Rails Engine, where I want to use Devise. I installed devise like normal following this guide.
I added this in my engine devise.rb:
Devise.setup do |config|
config.router_name = :cms_user
end
I added this in my routes file:
Cms::User::Engine.routes.draw do
devise_for :users, {
class_name: 'Cms::User',
module: :devise
}
end
I added this in my routes:
devise_for :users, {
class_name: 'Cms::User',
module: :devise
}
However I keep getting this error:
undefined method 'cms_user'
What am I doing wrong ?
Here's the how to:
2: Install devise like normal
3: Add this in the main application routes file:
This line here, mentioned in the devise wiki, caused the problems for me:
Wiki: https://github.com/plataformatec/devise/wiki/How-To:-Use-devise-inside-a-mountable-engine