From adb61b81ba65ace72116eb3b939378b98609cffd Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 16 Nov 2019 10:48:56 +0800 Subject: [PATCH 1/3] Update personal_projects_controller.rb fix search error --- app/controllers/personal_projects_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/personal_projects_controller.rb b/app/controllers/personal_projects_controller.rb index 0ea41d8..91c9b12 100644 --- a/app/controllers/personal_projects_controller.rb +++ b/app/controllers/personal_projects_controller.rb @@ -29,6 +29,10 @@ class PersonalProjectsController < ApplicationController projects_show = projects_temp.select { |value| search_all_words(t(value.send('language')), params[:keywords]) } when 'participator' projects_show = projects_temp.select { |value| search_all_words(get_authors_text(value), params[:keywords]) } + when 'abstract' + projects_show = projects_temp.select { |value| search_all_words(Nokogiri::HTML(value).text, params[:keywords]) } + when 'note' + projects_show = projects_temp.select { |value| search_all_words(Nokogiri::HTML(value).text, params[:keywords]) } else projects_show = projects_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) } end From 204827b6be070d86ed8966be9bea17409c8021d4 Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 16 Nov 2019 10:49:38 +0800 Subject: [PATCH 2/3] Update personal_projects_controller.rb fix search error --- app/controllers/personal_projects_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_projects_controller.rb b/app/controllers/personal_projects_controller.rb index 91c9b12..262493d 100644 --- a/app/controllers/personal_projects_controller.rb +++ b/app/controllers/personal_projects_controller.rb @@ -30,9 +30,9 @@ class PersonalProjectsController < ApplicationController when 'participator' projects_show = projects_temp.select { |value| search_all_words(get_authors_text(value), params[:keywords]) } when 'abstract' - projects_show = projects_temp.select { |value| search_all_words(Nokogiri::HTML(value).text, params[:keywords]) } + projects_show = projects_temp.select { |value| search_all_words(Nokogiri::HTML(value.abstract).text, params[:keywords]) } when 'note' - projects_show = projects_temp.select { |value| search_all_words(Nokogiri::HTML(value).text, params[:keywords]) } + projects_show = projects_temp.select { |value| search_all_words(Nokogiri::HTML(value.note).text, params[:keywords]) } else projects_show = projects_temp.select { |value| search_all_words(value.send(params[:selectbox]).to_s, params[:keywords]) } end From a9ea5102ac5360b016205ae73aee1e418087fd93 Mon Sep 17 00:00:00 2001 From: chiu Date: Sat, 16 Nov 2019 12:40:42 +0800 Subject: [PATCH 3/3] fix link error --- app/views/admin/projects/index.html.erb | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/app/views/admin/projects/index.html.erb b/app/views/admin/projects/index.html.erb index d55cc36..a4ed3ef 100644 --- a/app/views/admin/projects/index.html.erb +++ b/app/views/admin/projects/index.html.erb @@ -1,17 +1,7 @@