From 1b4f589d419e43f77f3a716af75ed865219a8666 Mon Sep 17 00:00:00 2001 From: chiu Date: Tue, 13 Aug 2019 10:03:33 +0800 Subject: [PATCH] Update personal_journals_controller.rb --- app/controllers/personal_journals_controller.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/app/controllers/personal_journals_controller.rb b/app/controllers/personal_journals_controller.rb index 50b33e8..19e5573 100644 --- a/app/controllers/personal_journals_controller.rb +++ b/app/controllers/personal_journals_controller.rb @@ -25,6 +25,9 @@ class PersonalJournalsController < ApplicationController 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]} + { + "all" => journal_papers_show + } else journal_paper_list = [] journal_papers.each do |journal_paper| @@ -75,11 +78,6 @@ class PersonalJournalsController < ApplicationController "all" => journal_papers_temp } end - if params[:selectbox] !=nil - { - "all" => journal_papers_show - } - end end def show