diff --git a/app/helpers/members_helper.rb b/app/helpers/members_helper.rb index 29ba94924..c8e8bd87b 100644 --- a/app/helpers/members_helper.rb +++ b/app/helpers/members_helper.rb @@ -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')