<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
	<channel>
		<title><![CDATA[Rails Forum - Ruby on Rails Help and Discussion Forum - reversing list view order?]]></title>
		<link>http://railsforum.com/viewtopic.php?id=1170</link>
		<description><![CDATA[The most recent posts in reversing list view order?.]]></description>
		<lastBuildDate>Fri, 10 Nov 2006 21:02:33 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: reversing list view order?]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=5827#p5827</link>
			<description><![CDATA[<p>You can simply reverse the items array:</p><p><pre name="code" class="ruby:nogutter">&lt;% for item in @items.reverse %&gt;</pre><br />However, this isn&#039;t guaranteed to sort newest to oldest. Instead you should add a created_at datetime column to the items table and order by that when you do the find:</p><p><pre name="code" class="ruby:nogutter">@items = Item.find(:all, :order =&gt; &#039;created_at DESC&#039;)</pre></p>]]></description>
			<author><![CDATA[dummy@example.com (ryanb)]]></author>
			<pubDate>Fri, 10 Nov 2006 21:02:33 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=5827#p5827</guid>
		</item>
		<item>
			<title><![CDATA[reversing list view order?]]></title>
			<link>http://railsforum.com/viewtopic.php?pid=5826#p5826</link>
			<description><![CDATA[<p>I have a simple list view (based on the automatic code generated from &quot;generate scaffold&quot;).</p><p>Currently, when I create a new item, it appears at the bottom of the list, and the whole list displays with the oldest first. How do I reverse this order so the newest item appears on top; oldest at the bottom?</p>]]></description>
			<author><![CDATA[dummy@example.com (dsinker)]]></author>
			<pubDate>Fri, 10 Nov 2006 20:59:50 +0000</pubDate>
			<guid>http://railsforum.com/viewtopic.php?pid=5826#p5826</guid>
		</item>
	</channel>
</rss>
