<ul>
<% @articles.each do |article| %>
<li>
<article>
<header><h1><%= link_to article.title, article %></h1></header>
<%= link_to(article, class: 'imgLk') do %>
<figure>
<%= image_tag(article.image_url) %>
</figure>
<% end %>
<p><%= truncate(strip_tags(article.content), length: 100) %></p>
<footer>
<ul class="actions clearfix">
<li class="clearfix"><%= link_to 'Edit', edit_article_path(article) %></li>
<li class="clearfix"><%= link_to 'Destroy', article, method: :delete, data: { confirm:'Are u sure?' } %></li>
</ul>
</footer>
</article>
</li>
<% end %>
</ul>
它输出是最新发表的排在最后。