Created by: jayroh
There are quite a few private methods that do some work translating the concept of "this controller" to a name, a title, a class, etc.
In attempting to implement dashboards for some namespaced models I ran into some limitations with the current code. I made an attempt below to pull together the private methods that fall into the scope of what I would call a "resource resolver" (or maybe a "resource factory"?). Delegating to an object that returned the type of information, or objects, that we want from the controller's path sounds like a reasonable abstraction.
The base administrate application controller would ideally and
eventually delegate the updated methods to
ResourceResolver.new(controller_path)
.
The changed methods below are to illustrate a collection of base use cases and how they would end up looking.