Posts Tagged RoR

Ruby On Rails, dynamic table’s & add button using nested_attributes

So here’s the problem, you want to create several items that belong to one item, normally you would just the the has_many and belongs_to (OneToMany) relation in rails. Using this model you create the primary model (such as purchase order) then create several sub items (such as item) and attach them to the primary model. The problem with this is its time consuming and does not always make sense to do things this way, take the Purchase order and Items scenario, it makes much more sense to create the Purchase order and assciated Items in the same form. This is possible in rails uing nested_attributes.

Read the rest of this entry »

, , , , ,

No Comments