Using Devise in mounted rails on an engine outside the engine

I have a hq_core engine, and I have another rails application called hq.

hq_core has a built-in user interface that works great with hq. I did this with this guide

I want to create the created admin_user, which is only in hq, not in hq_core. I ran the typical "rails g devise admin_user" which set find to hq.

But when I am in localhost: 3000 / admin_users / sign_in, it says

ActionView::Template::Error (undefined method `admin_user_session_path' for #<ActionDispatch::Routing::RoutesProxy:0x007fb454403818>): 

This is rails 4 app with Devise 3.0.0rc

+4
source share
1 answer

I had the same problem that I solved by adding

 Devise.setup do |config| config.router_name = :<your engine name here> end 

for my config / initializers / devise.rb as instructed.

+1
source

Source: https://habr.com/ru/post/1494568/


All Articles