Topic: Complex Data Model Question (Data Table Layouts)
I am tasked with solving a very complex problem. I am building an inventory system for an electrical company. The company has about a dozen categories of products. Each category has multiple products under it. Each product has one or more data tables that look like below.
On some products, there are multiple tables that have multiple layouts (different columns)
I am at a loss as to how to implement this in my application. What I am thinking right now is to have a model called Part that has a has_many relationship to another model called PartRows. PartRows is STI-based with different subclasses with different validation rules (for each of the dozen main categories).
My main issue is how to determine what fields to show for the user after they select their category type and then how to render those tables for the user.
Has anyone implemented something similar to this and can provide some sort of guidance?