课程成员配置-添加成员:没有搜索条件则显示空

This commit is contained in:
sw 2015-04-09 14:32:14 +08:00
parent 6abdc4c7e1
commit 0743ac2c78
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,11 @@ module MembersHelper
# add by nwb
# 课程可添加的成员列表
def render_principals_for_new_course_members(course)
scope = Principal.active.sorted.not_member_of_course(course).like(params[:q])
if params[:q] && params[:q] != ""
scope = Principal.active.sorted.not_member_of_course(course).like(params[:q])
else
scope = []
end
principals = paginateHelper scope,10
s = content_tag('ul', project_member_check_box_tags_ex('membership[user_ids][]', principals), :class => 'mb5', :id => 'principals')