私は逆の方法を表示する私のブログの記事が必要です。投稿1は投稿2の下にあるはずです。
This is my code which loops through the posts & renders
them:
<div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div> 'Are you sure?', :method => :delete %></div>
</div>
ベストアンサー
コントローラーの @posts
に割り当てる前に並べ替えます。
レール3:
@posts = Posts.order('id DESC')
ここの利点は、他の列でも並べ替えることができる小さな仕事です…