Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Andrew Flack
2,438 PointsProblem with Rails app lesson- "Updating Index Page"
To try and put it simply, I'm having a problem where all the information about my statuses is being inserted into the page below the ".status" div. I've included my code below and beneath that the text that is being inserted into the page.
Anyone know why this is happening and how I can remove this text?
<%= @statuses.each do |status| %>
<div class="status">
<strong><%= status.name %></strong>
<p><%= status.content %></p>
</div>
<% end %>
"[#Status id: 1, name: "cool_guy", content: "super cool status", created_at: "2013-12-18 21:19:10", updated_at: "2013-12-18 21:19:10"]"
1 Answer
Ricardo De la Fuente
6,782 PointsTry using <% @statuses.each do |status| %> instead; <%= %> should be used to output values onto the screen, whilst <% %> should be used for executing code.
Andrew Flack
2,438 PointsAndrew Flack
2,438 PointsI should have suspected it was something as simple as that! Thanks for the help.