From fd8ebb2e1b73752699eacc7a2c74ca55f0fc1ffa Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:10:50 +0800 Subject: [PATCH] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 92b7892..32b22b1 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -73,6 +73,10 @@ class PersonalJournalsController < ApplicationController choice_value.unshift("paper_title") choice_default = OrbitHelper.params[:locale]!='en' ? "——選取分類——" : "——select class——" choice_show.unshift(choice_default) + journal_papers1 = Mongoid::Sessions.default[:journal_papers].find() + journal_papers_count = journal_papers1.count + journal_papers_temp = journal_papers1.take(journal_papers_count) + journal_papers_show = journal_papers_temp.select {|value| value["paper_title"].include? "1"} { "journal_papers" => journal_paper_list, "headers" => headers, @@ -80,7 +84,7 @@ class PersonalJournalsController < ApplicationController "total_pages" => journal_papers.total_pages, "choice" => {"choice_value" => choice_value ,"choice_show" => choice_show}, "url" => "/"+params[:locale]+params[:url], - "all" => journal_papers_temp + "all" => journal_papers_show } end end