作业列表降序排序

This commit is contained in:
sw 2015-06-04 11:19:37 +08:00
parent 0d292d8ee6
commit ae27e4062f
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ class HomeworkCommonController < ApplicationController
before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment]
def index
homeworks = @course.homework_commons
homeworks = @course.homework_commons.order("created_at desc")
@is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,@course))
@is_student = User.current.logged? && (User.current.admin? || (User.current.member_of_course?(@course) && !@is_teacher))
@homeworks = paginateHelper homeworks,20