I am trying to create, display and edit a referenced object’s text field
on the same view as my root object. I have just about come to the
conclusion that whoever invented of taglibs should be shot.
quiz.preamble_presentation references a Presentation object instance.
The Presentation object contains a property called text, among others.
The generated form will display the ID of the presentation, but I cannot
figure out for the life of me how to display/edit the contents of the
text property of the presentation.
What (I think) I want to display/edit is quiz.preamble_presentation.text
Thanks in advance,
David J.
The quiz/_form.rhtml contains:
<%= error_messages_for ‘quiz’ %>
Name
<%= text_field 'quiz', 'name' %>
Preamble
presentation
<%= text_field 'quiz', 'preamble_presentation' %>
Postamble
presentation
<%= text_field 'quiz', 'postamble_presentation' %>
The ddl for the tables is:
create table presentations
(
ID char(36) not null primary key,
text varchar (1024),
audio varchar (1024),
visual varchar (1024)
);
create table quizzes
(
ID char(36) not null primary key,
name varchar (255) not null,
preamble_presentation char(36),
postamble_presentation char(36),
foreign key (preamble_presentation) references presentations(ID),
foreign key (postamble_presentation) references presentations(ID)
);