From 9553ede2f9f712776d5259dad2e02306adee3e93 Mon Sep 17 00:00:00 2001 From: chiu Date: Wed, 14 Aug 2019 16:25:45 +0800 Subject: [PATCH] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c4170b6..805f9db 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -37,6 +37,8 @@ class PersonalJournalsController < ApplicationController journal_papers_show = journal_papers_temp.select {|value| value.send("publication_date").strftime("%Y/%m").collect{|x| x.title}.join(', ').include? params[:keywords]} when "author_type" journal_papers_show = journal_papers_temp.select {|value| value.journal_paper_author_types.collect{|jat| jat.title}.join(", ").include? params[:keywords]} + when "language" + journal_papers_show = journal_papers_temp.select {|value| (!value.language.nil? ? t("#{value.language}") : "").include? params[:keywords]} else journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} end @@ -68,6 +70,8 @@ class PersonalJournalsController < ApplicationController t << {"value" => (journal_paper.send(fs).strftime("%Y/%m") rescue "")} when "author_type" t << {"value" => (journal_paper.journal_paper_author_types.collect{|jat| jat.title}.join(", ") rescue "")} + when "language" + t << {"value" => (!journal_paper.language.nil? ? t("#{journal_paper.language}") : "")} else t << {"value" => journal_paper.send(fs)} end