From 4595cac2d9079c058e6f98fd4ac048c65872af09 Mon Sep 17 00:00:00 2001 From: "sylor_huang@126.com" Date: Sat, 9 May 2020 17:14:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9ignore/category/license/langu?= =?UTF-8?q?age=E7=9A=84index=E7=AD=9B=E9=80=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/ignores_controller.rb | 4 +++- app/controllers/licenses_controller.rb | 4 +++- app/controllers/project_categories_controller.rb | 4 +++- app/controllers/project_languages_controller.rb | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/app/controllers/ignores_controller.rb b/app/controllers/ignores_controller.rb index 2afe28e27..5eeba5b0d 100644 --- a/app/controllers/ignores_controller.rb +++ b/app/controllers/ignores_controller.rb @@ -1,5 +1,7 @@ class IgnoresController < ApplicationController def index - @ignores = Ignore.search(params[:name]).without_content + #@ignores = Ignore.search(params[:name]).without_content + q = Ignore.ransack(name_cont: params[:name]) + @ignores = q.result(distinct: true) end end diff --git a/app/controllers/licenses_controller.rb b/app/controllers/licenses_controller.rb index 8639d7f32..6e3ee8f0e 100644 --- a/app/controllers/licenses_controller.rb +++ b/app/controllers/licenses_controller.rb @@ -1,5 +1,7 @@ class LicensesController < ApplicationController def index - @licenses = License.search(params[:name]).without_content + #@licenses = License.search(params[:name]). + q = License.ransack(name_cont: params[:name]) + @licenses = q.result(distinct: true) end end diff --git a/app/controllers/project_categories_controller.rb b/app/controllers/project_categories_controller.rb index 9a113c449..116a79281 100644 --- a/app/controllers/project_categories_controller.rb +++ b/app/controllers/project_categories_controller.rb @@ -1,6 +1,8 @@ class ProjectCategoriesController < ApplicationController def index - @project_categories = ProjectCategory.search(params[:name]).without_content + # @project_categories = ProjectCategory.search(params[:name]).without_content + q = ProjectCategory.ransack(name_cont: params[:name]) + @project_categories = q.result(distinct: true) end def group_list diff --git a/app/controllers/project_languages_controller.rb b/app/controllers/project_languages_controller.rb index bd6848b81..7f7e8bf75 100644 --- a/app/controllers/project_languages_controller.rb +++ b/app/controllers/project_languages_controller.rb @@ -1,5 +1,7 @@ class ProjectLanguagesController < ApplicationController def index - @project_languages = ProjectLanguage.search(params[:name]).without_content + #@project_languages = ProjectLanguage.search(params[:name]). + q = ProjectLanguage.ransack(name_cont: params[:name]) + @project_languages = q.result(distinct: true) end end