Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

« Newer Snippets
Older Snippets »
1 total  XML / RSS feed 

Find last article

Add this to your Article model (or whatever you name it) to get the last published article on your site.

def Article.find_last
  Article.find(:first, :order => "created_at DESC")
end
« Newer Snippets
Older Snippets »
1 total  XML / RSS feed