How to construct a Rails view to edit an associated data set -


I am developing a rail application to keep track of the product manufacturing run. Each run is done in different quantities. I have a model, run, in which there are many product_one objects, including the parameter 'quantity' and an is_one product. I'm having trouble creating a view to enter all the quantities to run, display all the products with just one box to enter the volume. To do this, any help on the right track will be appreciated.

Take a look at everything there should be

active nested records Attributes

With nested attributes, you can save attributes on the respective records through the parents. By default the nested attribute update is turned off and you can enable it by using the #accepts_nested_attributes_for class method. When you enable nested attributes, the attribute author is defined on the model.

The attribute writer is named after the Association, which means that in the following example, two new modes have been added to your model:

author_attributes = (attributes) and pages_attributes = (Attributes).

  # app / model / book.rb class book & lt; ActiveRecord :: Base has_one: Author has_many: pages accepts_nested_attributes_for: author, pages end  

Comments