In my app I created a recent posts feature.
@recentposts = Post.all(:order => \'created_at DESC\', :limit => 5)
This variable makes
Just write:
@recentposts = Post.order('created_at DESC').limit(5)
The to_a is not explicitly necessary, as the data is lazy loaded when needed.
to_a