Order by date

Hi,

I am trying to create a site which displays news from different
sources. I have the news articles in a MySQL database. On the
list.rhtml page I display the news articles but they are stored in the
db in no particular order. How do I get ruby to order these by date,
newest first, when they are displayed?

Thanks, Lewis

NewsArticle.find(:all, :order => “created_on DESC”)

assuming, you model is named NewsArticle and has the timestamps

Thanks, my model is named feeditems and the timestamp column is called
publishdate.

How do I update the code to reflect this?

On 14 Nov, 20:30, Thorsten M. [email protected]

Lewis wrote:

Thanks, my model is named feeditems and the timestamp column is called
publishdate.

How do I update the code to reflect this?

On 14 Nov, 20:30, Thorsten M. [email protected]

FeedItems.find(:all, :order => “publishdate DESC”)