Custom controller is assumed to have a related model
Created by: naps62
I want to have an admin dashboard where I show some useful data. This is not necessarily tied to a single resource model
My first attempt was to create a Admin::OverviewController
with an index
action.
However, the sidebar calls Administrate::Namespace.new(namespace).resources
, which, I eventually discovered, is computed by listing all controllers for which administrate has routes. So it would end up looking for an Overview model
I generated the sidebar template, and monkey patched it with this:
(Administrate::Namespace.new(namespace).resources - [:overview]).each
to explicitly remove the overview from the list of resources. This is ugly as hell though
Is there currently a better solution for this?