From 9ab4bdefb00c1e55b51ff52fb53fae34f47eb3a6 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 19 Aug 2019 13:54:10 +0800 Subject: [PATCH] Update personal_journals_controller.rb fix error? --- app/controllers/personal_journals_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 14ba882..0f04765 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.collect{|x| x.title}.join(", "), params[:keywords])} + journal_papers_show = journal_papers_temp.select {|value| search_all_words(value.journal_paper_type.title, params[:keywords])} when "language" journal_papers_show = journal_papers_temp.select {|value| search_all_words((!value.language.nil? ? t("#{value.language}") : ""), params[:keywords])} else @@ -71,7 +71,7 @@ class PersonalJournalsController < ApplicationController when "author_type" t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} when "paper_type" - t << {"value" => (journal_paper.journal_paper_type.collect{|x| x.title}.join(', ') rescue "")} + t << {"value" => (journal_paper.journal_paper_type.title rescue "")} when "language" t << {"value" => (!journal_paper.language.nil? ? t("#{journal_paper.language}") : "")} else