Update personal_journals_controller.rb

改搜尋框為可支持多國語言
This commit is contained in:
chiu 2019-08-19 14:21:18 +08:00
parent 00bc6b4355
commit b4e220918e
1 changed files with 3 additions and 3 deletions

View File

@ -96,13 +96,13 @@ class PersonalJournalsController < ApplicationController
choice_select=choice_value.map{|iter| iter==params[:selectbox] ? "selected" : ""}
choice_select=choice_select.map{|value| {"choice_select" => value}}
choice_value=choice_value.map{|value| {"choice_value" => value}}
choice_default = params[:locale]!='en' ? "——選取分類——" : "——select class——"
choice_default = t("personal_journal.select_class")
choice_show.unshift(choice_default)
choice_show=choice_show.map{|value| {"choice_show" => value}}
choice=choice_value.zip(choice_show,choice_select)
choice=choice.map{|value| value.inject:merge}
select_text = params[:locale]!='en' ? "搜尋類別:" : "search class:"
search_text = params[:locale]!='en' ? "關鍵字搜尋:" : "word to search:"
select_text = t("personal_journal.search_class")
search_text = t("word_to_search")
{
"journal_papers" => journal_paper_list,
"headers" => headers,