I have a model category which contains a field called category.parent_id which is used to create a taxonomy (top level categories with sub categories).
At the moment my index page shows the categories as:
Top level category
Sub category
Sub category
Top category
How could I order them in a proper taxonomy (i.e. first all top level categories are taken from db then sub categories, etc) and shown as the following:
Top level category
-- Sub category
-- Sub category
Top category
After hours of banging my head against the wall, I came up with this solution:
ActiveAdmin can not render a partial for the entire index, however you can render one for a single column!
So the work around was to create a column for sub categories like this:
And then in
_children.html.erbview partial you can print out the list like this: