Forum: Ruby Writing to Parent and Child table at the same time

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
1a287e4e8f6cf761a79b902eaf3866e8?d=identicon&s=25 JimNJ72 (Guest)
on 2006-03-05 06:49
(Received via mailing list)
I am new to Ruby on Rails and Relationonal Database Development in
general.   I have been a notes/domino (formula, lotusscript), html,
javascript coder for 10 years.  I am building user authentication into
a new app and am stuck right at the beginning.  I have a MySQL database
called ACT and have two tables one being uat (parent table) which has
a, id, username and password.  I then have another uai (child) which
holds other info such as address, city, state, zip, first name, last
name, etc.  I would like to keep the two seperate.  The child table
also has a foreignID (I think thats what its called) which is called
uat_id which creates the relationship between the tables.  I have
generated the model and controller in rails and setup the scaffold: uat
and scaffold :uai as well as setting the belongs to relationship in the
uai and the has one relationship in the uat because each user record
should also only have one user info record.  My question is how do I
get the data populated in both tables (parent and child) using one
form.  The auto generated rails NEW works independently for the Parent
and did work independently for the child before I setup the
relationship.  I plan on replacing with a custom form anyhow in the
future so thats not a problem but how do I get one form submit to write
or update both tables with the fields on one form that come from both
tables.   Any help or direction would be greatly appreciated.

Thanks,
Jim

jimnj72@optonline.net
This topic is locked and can not be replied to.