From e63216832636d0d91ae4468942c19ecb6543e68d Mon Sep 17 00:00:00 2001 From: Eric Tsai Date: Thu, 13 Feb 2020 15:47:52 +0800 Subject: [PATCH] let activities order by year --- app/controllers/admin/activities_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/admin/activities_controller.rb b/app/controllers/admin/activities_controller.rb index bbe9040..38befd1 100644 --- a/app/controllers/admin/activities_controller.rb +++ b/app/controllers/admin/activities_controller.rb @@ -9,7 +9,7 @@ class Admin::ActivitiesController < OrbitMemberController #before_action :allow_admin_only, :only => [:index, :setting] def index - @activities = Activity.all.page(params[:page]).per(10) + @activities = Activity.order_by(:year => 'desc').page(params[:page]).per(10) respond_to do |format| format.html format.xml { render :xml => @activities }