我在做Jumpstart教程,您必須在rails上創建一個博客。它進展良好,但我沒有設法弄清楚一件事。 根頁面應該顯示文章列表。它確實如此。只有它也表明了這額外位: Article list and unwanted part at the bottom文章列表還顯示查看所有文章的數據庫信息
我在查看代碼:
<h1> All Articles </h1>
<ul id="articles">
<%= @articles.each do |article| %>
<li>
<%= link_to article.title, article_path(article), class: 'article_title' %>
</li>
<% end %>
</ul>
<%= link_to "Create New Article", new_article_path, class: 'new_article' %>
這裏是在控制器的相關代碼
def index
@articles = Article.all
end
我希望得到任何幫助爲什麼會發生這種情況。
謝謝!我沒有看到它,但我甚至不知道它是如何影響我的代碼的,即使我有! –