Closed anastasiaalt closed 8 years ago
Anastasia,
You just have to be really specific when nesting each loops in Ruby. I tried this in place of the for loop you tried and it seemed to work:
<% question.options.each do |option| %>
<%= option.name %>
<% end %>
Let me know if that helps.
Ammmmmmaaaaaazing! :) :+1:
I am trying to get all the options for a particular question for a particular quiz (options<question<quiz) to display. I have googled and tried various different syntax for nested loops. I am able to get all the questions for a particular quiz to display successfully (questions<quiz) but not able to go one layer deeper.... Here is my latest failing attempt (I have tried 10 or so related syntax experiments to this, moving around the end, adding a for and removing a for, adding the instance or @ and taking away, etc). I understand the concept but just not the syntax....