From 5649cc545ea1821e43ff2f2f8e776c3ac417656f Mon Sep 17 00:00:00 2001 From: z9hang Date: Wed, 14 May 2014 15:22:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A1=B9=E7=9B=AE=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E7=95=8C=E9=9D=A2=E6=90=9C=E7=B4=A2=E7=A9=BA=E5=80=BC?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/projects_controller.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index a120394e..01021cb5 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -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']