Topic: EachDo wierd behavoir... help[SOLVED NVR MIND]
So I have a simple each do block that is meant to output a list of page names associated with website that has been passed to the page as an instance variable. It works! Yay! Except, it is printing the entire array as text at the end of the block. What gives?
<section id="pagesList"> <ul> <%= @website.page.each do |p|%> <li><%= p.ptitle %></li> <% end %> </ul> </section>
<section id="pagesList"> <ul> <li>Home</li> <li>Bio</li> [#<Page id: 1, website_id: 1, ... updated_at: "2012-06-29 17:14:56">] </ul> </section>
SOLVED: The each do block need the be in a <% ... %> not <%= ... %>, Lol, it is the little things in life that make the difference.
Last edited by acooper86 (2012-06-29 13:43:00)