From 8154c75e1fc32c4ecae88f4e89dde27342804d3e Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 08:43:25 +0800 Subject: [PATCH] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index c0d79c5..a870622 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -45,6 +45,7 @@ class PersonalJournalsController < ApplicationController end headers = [] + choice_show = [] fields_to_show.each do |fs| col = 2 col = 3 if fs == "paper_title" @@ -52,10 +53,10 @@ class PersonalJournalsController < ApplicationController "head-title" => t("personal_journal.#{fs}"), "col" => col } + choice_show << t("personal_journal.#{fs}") end choice_value = fields_to_show choice_value.unshift("paper_title") - choice_show = headers.select ( :"head-title" ) choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) { @@ -65,6 +66,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => OrbitHelper.params[:locale]+OrbitHelper.params[:url] + "all" => journal_papers.first } end