Update personal_journals_controller.rb

This commit is contained in:
chiu 2019-08-13 16:09:18 +08:00
parent b23a4f76ef
commit 037d488a21
1 changed files with 1 additions and 1 deletions

View File

@ -40,7 +40,6 @@ class PersonalJournalsController < ApplicationController
else else
journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]} journal_papers_show = journal_papers_temp.select {|value| value.send(params[:selectbox]).to_s.include? params[:keywords]}
end end
journal_papers.total_pages = (journal_papers_temp.length / OrbitHelper.page_data_count.to_f).ceil
if params[:page_no].nil? if params[:page_no].nil?
page_to_show = 1 page_to_show = 1
else else
@ -48,6 +47,7 @@ class PersonalJournalsController < ApplicationController
end end
journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count] journal_papers_show_last = journal_papers_show[(page_to_show-1)*OrbitHelper.page_data_count...page_to_show*OrbitHelper.page_data_count]
journal_papers = journal_papers_show_last journal_papers = journal_papers_show_last
journal_papers.total_pages = (journal_papers_temp.length / OrbitHelper.page_data_count.to_f).ceil
else else
end end
journal_paper_list = [] journal_paper_list = []