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

Ruby

[Help] erb-loops challenge 2 of 3

http://teamtreehouse.com/library/programming/build-a-simple-ruby-on-rails-application/frontend-development/erb-loops

<div class="page-header">
  <h1>All Statuses</h1>
</div>
<% @statuses.each do |status| %>
 Name: <%= status.name %>
  <div class="status">
    <% end %>
    <p> </p>
  </div>

Seems like my script is wrong. Issue:

Bummer! Make sure the output of the status's name is inside the h2 tag in the loop.

2 Answers

It looks like you've got the right idea, but have just removed a few necessary pieces and got some things in the wrong order. The loop should surround the entire div with the "status" class. Then the erb output tags for the status name and status content should go inside the h2 and the p elements, respectively.

Have another go at it and see if you can get it this time. :muscle:

<div class="page-header">
  <h1>All Statuses</h1>
</div>

    <% @statuses.each do |status| %>
    <div class="status">
    <h2>Name: <%= status.name %></h2>
    <p>Status: <%= status.content %> </p>
  </div>
<% end %>

Booya! Thx Sean :)