In my application I have stories and substories. Substories are nested inside stories and on the storiesindex.html.erb. I\'m looping trough all the
index.html.erb
<% story.substories.each do |substory| %> <%= substory.title %> <%= substory.subplot %> <% if substory %> <%= link_to 'Edit', edit_story_substory_path(substory.story, substory) %> <% end %> <% end %>
You just made a typo. @substory would work too if you declare it on your Stories#index