return all published posts in reverse chronological order

This commit is contained in:
Sami Samhuri 2015-04-19 21:54:43 -07:00
parent f54e5f12e5
commit 776528024c

View file

@ -291,7 +291,7 @@ end
get '/posts' do
posts = blog.months.map do |year, month|
blog.posts_for_month(year, month)
end.flatten
end.flatten.reverse
status 200
headers 'Content-Type' => 'application/json'