From bdfbb408637d2d4cb1f062bea468a52e84681d70 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:00:33 +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 a6dc9e8..50b33e8 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -24,7 +24,7 @@ class PersonalJournalsController < ApplicationController journal_papers = Mongoid::Sessions.default[:journal_papers].find() journal_papers_count = journal_papers.count journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(journal_papers_count) - journal_papers_show = journal_papers_temp.select (|value| value[params[:selectbox]].include? params[:keywords]) + journal_papers_show = journal_papers_temp.select {|value| value[params[:selectbox]].include? params[:keywords]} else journal_paper_list = [] journal_papers.each do |journal_paper| @@ -75,9 +75,11 @@ class PersonalJournalsController < ApplicationController "all" => journal_papers_temp } end + if params[:selectbox] !=nil { "all" => journal_papers_show } + end end def show