Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1106071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:44:04+00:00 2026-05-17T01:44:04+00:00

Brief question, beginner’s work on Ruby/Rails. Here’s my view: <h1>News</h1> <%= @posts.each do |post|

  • 0

Brief question, beginner’s work on Ruby/Rails. Here’s my view:

<h1>News</h1>


<%= @posts.each do |post| %>

<h1><%= post.title %></h1>

<p><strong>By:</strong> <%= post.name %></p>

<p><%= post.content %></p>

<p><%= link_to 'Read More', post %> | <%= link_to 'Edit', edit_post_path(post) %> | <%= link_to 'Destroy', post, :confirm => 'Are you sure you want to delete this post?', :method => :delete %></p>

<p>hello!</p>

<% end %>

<br />



<%= link_to 'New Post', new_post_path %>

I put the <p>hello<p> in there so I could see where the output was coming from, but here’s what the page looks like…


News

sdfsfsdfsdf

By: sdf

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras a risus eros, sed malesuada lectus. Ut faucibus urna vel risus mollis et pulvinar augue gravida. Nunc ultricies viverra tellus…

Read More | Edit | Destroy

hello!

[#<Post id: 5, name: "sdf", title: "sdfsfsdfsdf", content: "Lorem ipsum dolor sit amet, consectetur adipiscing ...", created_at: "2010-09-28 22:43:57", updated_at: "2010-09-28 22:43:57">] 

New Post


That last dump, which looks like XML or a JSON object, following the loop, is not being told to print anywhere in the view…I don’t understand where it’s coming from, what it’s called, or how to get rid of it. Help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T01:44:05+00:00Added an answer on May 17, 2026 at 1:44 am

    Wild guess: change <%= @posts.each do |post| %> to <% @posts.each do |post| %> (notice lack of = sign).

    <% .. %> in erb template means “execute this”.
    <%= .. %> in erb template means “execute this and print output on the page”.

    @posts.each is a loop. It’s used to iterate over @posts collection. And even though each method returns some data (collection itself), there’s no need to print that data.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here's some brief background on my question; maybe the real answer is to just
The question, in brief: In MVC, how do you distinguish between a checkbox click
Brief question What command can I use to make my DataSet refresh it's connection
Brief version of my question: This code crashes the compiler. pThread[0] = new boost::thread(
In brief, my question is about member variables as pointers in unmanaged C++. In
I'm new to PHP, so this question might best be answered by a brief
Hello guys I think the question i asked in the previous post is unclear
I will try to be as brief as possible, please stay with me here
This maybe a bit of a 'wide' question, but am putting together a brief
This is my first question here on StackOverflow, and quite frankly I'm fairly new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.