我在做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
我希望得到任何帮助为什么会发生这种情况。
谢谢!我没有看到它,但我甚至不知道它是如何影响我的代码的,即使我有! –