views:

31

answers:

1

My application has got a parent and child table with a 'has_many' relationship.

Now I have created a nested form as described in the tutorials (using accept_nested_attributes_for) and this works fine.

Some information about my environment: Rails 2.3.8, authlogic

In my child table is a additional field "user" (the reference to the current user) to save the creator of this new entry.

When I try to update this field in my ParentsController (loop over children, assign @currrent_user to child.user), this only effects the already existing child-entries, but not the new entries.

I think for security reasons this field should not be editable (and therefore not exists in the form).

How can I solve this problem? Is this not the right place for updating this field?

Thanks in advance for your help!

A: 

Sorry for wasting your time.

I've set the code for updating entries of children table on the wrong place.

frank