作业顺序按照截止日期排序

This commit is contained in:
Wen 2014-04-02 16:04:14 +08:00
parent 992d2be6e4
commit 24d7234fec
1 changed files with 1 additions and 1 deletions

View File

@ -253,7 +253,7 @@ class ProjectsController < ApplicationController
#Added by young #Added by young
def homework def homework
@offset, @limit = api_offset_and_limit({:limit => 10}) @offset, @limit = api_offset_and_limit({:limit => 10})
@bids = @project.homeworks @bids = @project.homeworks.order('deadline DESC')
@bids = @bids.like(params[:name]) if params[:name].present? @bids = @bids.like(params[:name]) if params[:name].present?
@bid_count = @bids.count @bid_count = @bids.count
@bid_pages = Paginator.new @bid_count, @limit, params['page'] @bid_pages = Paginator.new @bid_count, @limit, params['page']