I'm stuck trying to setup a has_one relationship on my Cinema
Treasures project (which has a legacy db).
Need to display the status of a theater -- whether the theater is
open, closed, etc. -- for each theater in a list of theaters.
Theater has_one :status
Status has_many :theaters
The status table has two fields: an id field and a name field (which
has the full name for each status). Each theater has a field called
status_id, which is used to join the theater and status tables.
...
How can I display the name form of the theater status in this example?
<% for theater in @theaters %>
<%= theater.name %>
<%= NEED TO DISPLAY STATUS NAME HERE %>
<% end %>
Best,
Patrick
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby