Please help. I know the answer to this is *really* simple, but I can''t
figure it out.
Here''s my current setup:
mysql> desc owners;
+------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+----------------+
| id | int(10) | NO | PRI | NULL | auto_increment |
| first_name | varchar(25) | YES | | NULL | |
| last_name | varchar(25) | YES | | NULL | |
+------------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
mysql> desc computers;
+-------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+----------------+
| id | int(10) | NO | PRI | NULL | auto_increment |
| service_tag | varchar(10) | YES | | NULL | |
| owner_id | int(10) | YES | MUL | NULL | |
+-------------+-------------+------+-----+---------+----------------+
3 rows in set (0.00 sec)
Then:
./script/generate scaffold Owner
./script/generate scaffold Computer
I then added a few owners to the DB.
Now, I want to modify computers/new such that there''s the Service Tag
entry AND a drop down menu to select an owner.
I imagine this should be *really* simple but I can''t figure it out.
For whatever reason when I learn a new concept I have to try it my way,
and this is an easy way for me to visualize this problem.
Maybe, if I understood the above all of the literature that I''ve read
on table relations would make a lot more sense.
Thanx a lot!!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---