Forum: Ruby on Rails 'Has Many' in one View form?

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
D Roberts (Guest)
on 2006-04-09 22:43

Any help much appreciated.  I've got a controller with @questions, which
is an array of ProjectsQuestion model objects.

I've got @answers as well, which is an array of Answer model objects,
which are new and don't exist in the database yet.

For my view I want one form which lists each ProjectsQuestion followed
by a textarea field where a Person can provide their Answer for that
Question and a date which is stored with the Person.

Can anyone suggest an approach for the view and form post action to 1)
make the form I specified above, and 2) process/store the many answers a
person submits?  I'm having trouble with several things including id's
in the answer textareas for the many ansers a person gives (~7),
looping, ie: "for @question in @questions" doesn't give me an easy way
to access @answers, and more.

Thanks and I'm happy to provide more details...

All Best!
This topic is locked and can not be replied to.