Setting Active Admin namespace using active admin

2019-08-09 15:24发布

问题:

I am using active admin with devise and im trying to set namespace for all my active admin routes.

In active_admin.rb i have set the default_namespace as,

config.default_namespace = :abc_123

In the route i have,

  devise_for :admin_users, ActiveAdmin::Devise.config
  ActiveAdmin.routes(self)

The routes generated are such,

                           root GET        /                                              pages#home
         new_admin_user_session GET        /abc_123/login(.:format)                  active_admin/devise/sessions#new
             admin_user_session POST       /abc_123/login(.:format)                  active_admin/devise/sessions#create
                     admin_root GET        /admin(.:format)                              admin/dashboard#index
              abc_123_root GET            /abc_123(.:format)                        abc_123/dashboard#index
            abc_123_quotes GET            /abc_123/quotes(.:format)                 abc_123/quotes#index
                           POST           /abc_123/quotes(.:format)                 abc_123/quotes#create
         abc_123_quote     GET        /abc_123/quotes/new(.:format)             abc_123/quotes#new
        edit_abc_123_quote GET        /abc_123/quotes/:id/edit(.:format)        abc_123/quotes#edit
             abc_123_quote GET        /abc_123/quotes/:id(.:format)             abc_123/quotes#show
batch_action_abc_123_users POST       /abc_123/users/batch_action(.:format)     abc_123/users#batch_action
             abc_123_users GET        /abc_123/users(.:format)                  abc_123/users#index

The login works i am able to login with my activeadmin account but on dashboard it breaks with the error,

ActionView::Template::Error (undefined method `abc123_users_path' for ActiveAdmin::Helpers::Routes:Module):
1: insert_tag active_admin_application.view_factory["page"]

It breaks for all the other active admin page too with the same error. I don't have the 'abc123_users_path' path in my route. Im not getting from where this route is getting added to the active admin page.