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

  • Home
  • SEARCH
  • 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

The question, in brief: In MVC, how do you distinguish between a checkbox click
In brief: Is it ever excusable to have assembly names and class names stored
I happened upon a brief discussion recently on another site about C# runtime compilation
Could somebody give me a brief overview of the differences between HTTP 1.0 and
I'll try to be brief. What is the best practice for calling a routine
Let's put Heisenberg aside for a brief moment. How would I go about to,
I'm going to be brief because I'm short on time, so I apologize if
Basically, I would like a brief explanation of how I can access a SQL
Guys, can someone give me a brief run through of how to change the
Uhm I'm not sure if anyone has encountered this problem a brief description is

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.