Hi all,
happily coding along, but it seems a belongs_to record is not saved.
Create some stuff
def create_project
@contact = Contact.new
@project = Project.new(@params[‘project’])
@project_contact = ProjectContact.new(@params[‘collect’])
@project.project_contact = @project_contact
contact = Contact.find(@params['id']['collect'])
Copy fields
@project.project_contact['firstname'] = contact["firstname"]
@project.project_contact['lastname'] = contact["lastname"]
The above two vars are set, checked it with “breakpoint”
But not saved here!!!
@project.project_contact.save
if @project.save
flash[:notice] ... etc ...
Is this solved with a do loop, for all attribs? Shouldn’t AR take care
of
this? What am I missing?
Thnx n Grtz
Gerard
–
“Who cares if it doesn’t do anything? It was made with our new
Triple-Iso-Bifurcated-Krypton-Gate-MOS process …”
My $Grtz =~ Gerard;
~
:wq!