let activities order by year

This commit is contained in:
EricTYL 2020-02-13 15:47:52 +08:00
parent dce3a5b2c9
commit e632168326
1 changed files with 1 additions and 1 deletions

View File

@ -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 }