1
我以爲我正在關注這個RoR教程,但顯然不是。他們指示我們寫代碼到apps/views/index.html.erb
Rails 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 %>
它踢回一圈輸入10次錯誤,但我沒有確切的問題是什麼太清楚。有人能爲我發現一些情況嗎?
的錯誤是
syntax error, unexpected ')', expecting kDO_COND or ':' or '\n' or ';'
....concat((for post in @posts).to_s); @output_buffer.concat ...
有什麼錯誤? – 2010-07-30 04:52:45
錯誤無益。我把它貼在上面。 – Andy 2010-07-30 04:56:50