On Oct 19, 10:38 am, Hakjune Kim <[email protected]> wrote: > Thank you very much Frederick. > > I have changed my code according to it. > But in the form how I can implement this? > Once I'm using the same code it will display 3 fields since it's using > fields_for loop for all answers. >
just <%= field_for :answer_singles do |f| %> ... <% end %> will iterate over all of report.answer_singles and execute the block (e.g. to display a heading & a text area). rails takes cate of generating different names for form elements so that it doesn't get all mashed together. Since these are all unsaved elements, you'd probably want a hidden input to track the question id for the question corresponding to the text area you are showing. Fred > What can I use in this case? > > -- > Posted viahttp://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

