Displaying 1 result from an estimated 1 matches for "template_departments".
2009 Feb 19
3
Associated child records not created on creation of a parent.
...quot;parent_id"
5. belongs_to :department
6. belongs_to :prototype_model
7. end
Code :
1. # POST /prototype_models
2. # POST /prototype_models.xml
3. def create
4.
5. @template_model = PrototypeModel.find( params
[:prototype_model][:parent_id] )
6. template_departments = @template_model.departments
7.
8. @prototype_model = PrototypeModel.new(params
[:prototype_model])
9. @prototype_model.author = current_user
10.
11. for mydepartment in template_departments
12. logger.debug "Cloning Department #{mydepartment.name}"
13.
14....