Administrate::Namespace#namespace_controller_paths
Created by: elquimista
I am trying to add devise for admin authentication. Here's a routes.rb
file
...
namespace :admin do
resources :subscriptions
root to: 'subscriptions#index'
end
devise_for :admin_users, controllers: {
sessions: 'admin_users/sessions'
}
...
Now administrate throws a weird error saying uninitialized constant AdminUsers::Session
.
So I decided to dig this gem source code and turns out that this line causes this problem.
def namespace_controller_paths
all_controller_paths.select do |controller|
controller.starts_with?(namespace.to_s)
end
end
It should be controller.starts_with?("#{namespace.to_s}/")
instead, no?