作品搜索时,复制的姓名或学号或邮箱因为包含空格,而搜索不到相关结果

This commit is contained in:
cxt 2016-05-23 14:47:10 +08:00
parent 2afce9d563
commit 6586dfaf91
1 changed files with 1 additions and 1 deletions

View File

@ -374,7 +374,7 @@ class StudentWorkController < ApplicationController
end
end
##################################################################################################################
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group]
@homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now.strftime("%Y-%m-%d")).order("created_at desc")
@all_homework_commons = @course.homework_commons.order("created_at desc")
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?