I’m sorry to be asking trivial questions, but I’m new to RoR and am
hooked :), so I’m very impatient to get things up and running.
given two related tables, “pcs” and “venues” (venues have many PC’s and
each PC belongs to one venue only) I can use a select() to present venue
names in the “new PC” form along with other PC details to be
registered.
I’ve done this by adding <%= select(’’, ‘’, venue.find_all.collect
{|venue|
venue.name}) %>
to my _form.rhtml for registering new PC’s.
Now when you register a new PC, you can choose the venue that it
belongs to by name, but I need to then send the venue_id (the foreign
key in pcs) and not the venue name from the form. Can someone advise
me on how I might do this?
Also, I know that I’m really supposed to write something in the
appropriate controller or write a helper method to populate a variable
which I can then use in my _form.rhtml, but I’m not sure how to do
that and would appreciate pointers there too.
Bealach