From ac15dccd1635eb478c7e5e2b09294f8c513dc957 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 13:57:47 +0800 Subject: [PATCH] Update personal_journals_controller.rb fix error --- app/controllers/personal_journals_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 9791270..5a79635 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -37,7 +37,7 @@ class PersonalJournalsController < ApplicationController when "author_type" journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_author_types.collect{|jat| jat.title}.join(", "), params[:keywords])} when "paper_type" - journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_type.title.to_s, params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words((value.journal_paper_type.title rescue ""), params[:keywords])} when "language" journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""), params[:keywords])} else