![](/img/trans.png)
[英]Ruby On Rails getting the error: syntax error, unexpected keyword_ensure, expecting end-of-input
[英]Syntax Error: unexpected keyword_ensure, expecting end-of-input
致力於構建博客標簽列表以顯示在Rails項目中。 我有一個標簽控制器,並在一個名為index.html.erb的視圖上工作
這是該視圖的代碼:
<h1>
All Tags
</h1>
<ul id="tags">
<li><%= link_to tag.name, tag_path(tag), class: 'tag_title' %></li>
<% end %>
</ul>
但是,當我在服務器上嘗試提取標簽列表的代碼時,得到以下信息:
語法錯誤,意外的keyword_ensure,預期輸入結束
有任何想法嗎?
<% end %>
在您的代碼中是多余的
好像您有一個扼殺器end tag
1. <ul id="tags">
2. <li><%= link_to tag.name, tag_path(tag), class: 'tag_title' %></li>
3. <% end %>
4. </ul>
在第3行上。只需嘗試將其刪除
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.