Skip to content

Instantly share code, notes, and snippets.

@eqdw
Created December 15, 2010 16:34
Show Gist options
  • Save eqdw/742211 to your computer and use it in GitHub Desktop.
Save eqdw/742211 to your computer and use it in GitHub Desktop.
def archive
dates = Post.date_counts(3).sort{|a,b| b <=> a}
@links = dates.map do |elem|
year, month = elem[0].split(/\//)
{:string => DateTime.strptime(elem[0], "%Y/%m").strftime("%B %Y"), :year => year, :month => month}
@links = @links[]
end
render
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment