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 963101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:37:16+00:00 2026-05-16T01:37:16+00:00

I thought I was following this RoR tutorial to a T, but apparently not.

  • 0

I thought I was following this RoR tutorial to a T, but apparently not. They instructed that we write this code into apps/views/index.html.erb

<h1>Listing posts</h1>

<table>
    <tr>
        <th>Name    </th>
        <th>Title   </th>
        <th>Content </th>
    </tr>

<% for post in @posts %>
    <tr>
        <td><%=h post.name    %></td>
        <td><%=h post.title   %></td>
        <td><%=h post.content %></td>

        <td><%= link_to'Show', post                   %></td>
        <td><%= link_to 'Edit', edit_post_path(post)  %></td> 
        <td><%= link_to 'Destroy', post,
                 :confirm => 'Are you sure?',
                 :method  => :delete                  %></td>
    </tr>
<% end %>
</table>

<br />

<% link_to 'New Post', new_post_path %>

It kicks back an error around line ten, but I’m not too clear on what the exact issue is. Can someone shine some light on the situation for me?

The error is

 syntax error, unexpected ')', expecting kDO_COND or ':' or '\n' or ';'
....concat(( for post in @posts ).to_s); @output_buffer.concat ...
  • 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-16T01:37:17+00:00Added an answer on May 16, 2026 at 1:37 am

    So long as @posts is a collection of objects (presumably Post objects) that have attributes name title and content, and you have standard RESTful routes generated for the resource, your view is fine. Look at your controller.

    EDIT: the for…in syntax requires a do. for post in @posts do…

    So the error was helpful — the bit about KDO…

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

Sidebar

Related Questions

I'm following this example tutorial project code: http://akrabat.com/wp-content/uploads/zf-tutorial-layoutform.zip tutorial: http://akrabat.com/zend-framework/a-form-in-your-layout/ The project code runs
Ive got this following code in VB, want to use it into c# and
I thought the following code would work but it crashes when the target widget
In this MSO bug report , our very own waffles makes the following observation:
I'm currently reading this amazing book called Dive into Python. Up to now everything
Hello all and thanks for the attention! I have a problem that must both
I'm breaking my head over this for a while now and I have no
I have a page that uses an iframe to do an ajax style file
I need a relatively efficient way to share data between Matlab and R .
I currently have rails 3.0.3 and am trying to download and use version 3.0.1.

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.