Administrate::ResourceResolver always singularizes namespace.
Created by: timobleeker
-
What were you trying to do? Make a dashboard for a namespaced resource:
Users::Preference
-
What did you end up with (logs, or, even better, example apps are great!)?
uninitialized constant User::PreferenceDashboard
-
What versions are you running?
- Rails 6.0.3
- administrate 0.13.0
From reading the source of the Administrate::ResourceResolver
, it's always going to singularize the namespace:
def controller_path_parts
controller_path.split("/")[1..-1].map(&:singularize)
end
I don't understand why it would want to signularize the namespace part of the controller path. To my knowledge it is not possible to have Foo::Bar
in foos/bar.rb
. Would it not make more sense to just singularize the last part of the controller path?
Am I missing something, or is this a bug in administrate?