Topic: dynamically add fields to a form through select
I have a problem similar to that proposed in the popular Rayan Bates Railcasts episodes 197 (nested model form part 2).
I have a 3 nested models, a Survey that have many Questions which in turn have many answers.
Now the problem is, I want to put a select menu with the number of questions that I can have, and dynamically add or delete the fields for the questions and it's corresponding answers. For example the behavior must be: I want a Survey with three Questions and each question with at least one answer, then I choose the 3 option from the select menu, then the page add the necessary three fields for the question and for the answers.
I try to do this with an observe_field but i can't show the fields
if anyone has any advice, it would be very useful
Last edited by zclimber (2011-02-02 17:32:22)