Skip to content

Commit

Permalink
Adds default sorting of posts
Browse files Browse the repository at this point in the history
  • Loading branch information
kirichkov committed May 9, 2018
1 parent 7f04203 commit 3985f22
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/controllers/comfy/blog/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ def index

scope = scope.for_category(params[:category]) if params[:category]

scope = scope.order(:published_at).reverse_order

@blog_posts = comfy_paginate(scope, per_page: ComfyBlog.config.posts_per_page)
render layout: ComfyBlog.config.app_layout
end
Expand Down

0 comments on commit 3985f22

Please sign in to comment.