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

Rails inputting extra info in ERB.

Im trying to put together a blog and usually it's not that big of deal, but for some reason, after I put this little gem

<%= @posts.each do |post| %>
 <h3><%= post.title %></h3>
 <p><%= post.body %></p>
<% end %>

Everytime, I use this code I get what the content should be but at the end of all the generated content It seems to add the code that would come out of a rails console query.

Post id: 2, title: "What a title", body: "I have no idea how this is going to go, but I am g...", created_at: "2015-09-29 03:27:53", updated_at: "2015-09-29 03:27:53">, #<Post id: 3, title: "This is another post", body: "Just trying to see the dynamic creation of text", created_at: "2015-09-29 03:36:24", updated_at: "2015-09-29 03:36:24"

Not sure why this is happening. if anyone could look at my code and let me know, that would be awesome.

Nevermind... I answered my own question. There shouldn't be a = in the @posts.each line.