Update personal_projects_controller.rb

fix search error
This commit is contained in:
chiu 2019-11-16 10:48:56 +08:00
parent b4458dfd4b
commit adb61b81ba
1 changed files with 4 additions and 0 deletions

View File

@ -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