ruby-on-rails – Rails语法错误:意外的keyword_ensure,期望输入结束

我是rails的新手,我尝试根据教程创建一个论坛应用程序.这是我的论坛页面,但我一直收到错误
Syntax error,unexpected keyword_ensure,expecting end-of-input

Extracted source (around line #33):
30 
31    <p><% if admin? %><%= link_to "New Forum",new_forum_path %><% end %></p>

这是抛出错误的论坛索引页面

<% title "Forums" %>  

<table>  
  <tr>  
    <th width="70%">Forum</th>  
    <th width="30%">Last Post</th>  
  </tr>  
  <% for forum in @forums %>  
    <tr>  
      <td><h4><%= link_to h(forum.name),forum_path(forum.id) %></h4>  
        <small><%= forum.topics.count %> topics</small><br />  
        <%=h forum.description %></td>  
      <td class="right">
      <% if forum.most_recent_post %>
      <%= distance_of_time_in_words_to_Now forum.most_recent_post.last_post_at %>
       ago by 
       <%= link_to forum.most_recent_post.user.username,"/users/#{forum.most_recent_post.last_poster_id}" %>
       <% else %>no posts<% end %>
       </td>  
      <% if admin? %>
      <td><%= link_to "Edit",edit_forum_path(forum) %>
  <% end %></td>
  <!-- <% end %> -->  
  <% if admin? %>
  <td><%= link_to "Destroy",forum,:confirm => 'Are you sure?',:method => :delete %></td>
  <% end %>  
</tr>  
  <% end %>
<p><% if admin? %><%= link_to "New Forum",new_forum_path %><% end %></p>

解决方法

<! - <%end%> – >这是做什么的?一个html注释的ERB标记仍将评估.去掉它.如果你想评论ruby代码,请使用#,例如<%#end%>

相关文章

validates:conclusion,:presence=>true,:inclusion=>{...
一、redis集群搭建redis3.0以前,提供了Sentinel工具来监控各...
分享一下我老师大神的人工智能教程。零基础!通俗易懂!风趣...
上一篇博文 ruby传参之引用类型 里边定义了一个方法名 mo...
一编程与编程语言 什么是编程语言? 能够被计算机所识别的表...
Ruby类和对象Ruby是一种完美的面向对象编程语言。面向对象编...