修正项目列表界面搜索空值报错问题
This commit is contained in:
parent
77b5ce658b
commit
5649cc545e
|
@ -295,8 +295,12 @@ class ProjectsController < ApplicationController
|
|||
project_type = params[:project_type].to_i
|
||||
projects_all = (project_type.eql? Project::ProjectType_course) ? Project.course_entities : Project.project_entities
|
||||
@projects = projects_all.visible
|
||||
@projects_all = @projects.visible.like(params[:name]) if params[:name].present?
|
||||
|
||||
#@projects_all = @projects.visible.like(params[:name]) if params[:name].present?
|
||||
if params[:name].present?
|
||||
@projects_all = @projects.visible.like(params[:name])
|
||||
else
|
||||
@projects_all = @projects;
|
||||
end
|
||||
@project_count = @projects_all.count
|
||||
@project_pages = Paginator.new @project_count, per_page_option, params['page']
|
||||
|
||||
|
|
Loading…
Reference in New Issue