Firstly, my apologies if this question has already been answered elsewhere, but I could not find a single post that is related to this. Please redirect me to the answer if one already exists.
Now, I'm pretty new to Ruby/Rails web development and what I'm attempting to do is usually really straight forward in a JS Framework like React/Vue etc.
What I want to do is to extend an existing Administrate table/collection view of Product items with the ability to have expandable rows which represent Product groups.
The data change would be like this:
From: [Product, Product, Product]
To:
[{group=> ProductGroup, products=>[Product, Product]},
{group=> ProductGroup, products=>[Product, Product]},
Product,
Product]
The current administrate collection view is fine for a list of items that are of the same model. However, I've no clue on even how to introduce a list of items with varied types ({ProductGroup,Product} Hash-items as well as Product-items).
So my first question starts there; how do I customise the attributes of the table to allow for this, as currently it would error as some attributes expected in a Product-item are not defined in a {ProductGroup, Product} Hash-item.
The second question is how would I even start building the expansion functionality for a row, but that can be out of scope and answers would be granted additional 'you're very knowledgable' points.