Topic: Posting Children and Grandchildren in one Form
I am working on a project for a printing company and am facing some unique challenges with a pricing grid.
For an example of what I am working towards, http://www.fatratpress.com/cards/ scroll down to the pricing tables and you will see that each product has different sizes and then those sizes have prices and quantities. The models for this are easy pie:
class Product < ActiveRecord::Base
class Size < ActiveRecord::Base
class Price < ActiveRecord::Base
#also includes field for quantity
Where I end up scratching my head is in the controller and view. I found a plugin that deals elegantly with posting parent and a dynamic number of children:
But I am at a loss as to the best way to also post grandchildren like this.
Before I rip apart this plugin to suit my needs, I was curious what yall think of this solution.
Am I on the right path, or am I overcomplicating things?