From 976f97f4db5510688693bd453e4a4c2a93d79b2b Mon Sep 17 00:00:00 2001 From: BOHUNG Date: Fri, 20 Mar 2020 12:03:57 +0800 Subject: [PATCH] change order in admin page. --- app/controllers/admin/writings_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/writings_controller.rb b/app/controllers/admin/writings_controller.rb index 1eaea07..361a528 100644 --- a/app/controllers/admin/writings_controller.rb +++ b/app/controllers/admin/writings_controller.rb @@ -24,9 +24,9 @@ class Admin::WritingsController < OrbitMemberController end if params[:clear] != 'true' if(params[:new_filter] != nil && params[:new_filter][:type] == 'category') - @writings = Writing.where(:category_id.in=> @filter['category']).order_by(:year=>'desc').page(params[:page]).per(10) + @writings = Writing.where(:category_id.in=> @filter['category']).order_by(:year=>'desc',:month=>'desc',:id=>'desc').page(params[:page]).per(10) else - @writings = Writing.order_by(:year=>'desc').page(params[:page]).per(10) + @writings = Writing.order_by(:year=>'desc',:month=>'desc',:id=>'desc').page(params[:page]).per(10) end else redirect_to admin_writings_url