forked from saurabh/personal-journal
Update personal_journals_controller.rb
This commit is contained in:
parent
d62d9cc9a9
commit
25116235bf
|
@ -24,6 +24,7 @@ class PersonalJournalsController < ApplicationController
|
||||||
journal_papers = Mongoid::Sessions.default[:journal_papers].find()
|
journal_papers = Mongoid::Sessions.default[:journal_papers].find()
|
||||||
journal_papers_count = journal_papers.count
|
journal_papers_count = journal_papers.count
|
||||||
journal_papers_temp = Mongoid::Sessions.default[:journal_papers].find().take(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])
|
||||||
else
|
else
|
||||||
journal_paper_list = []
|
journal_paper_list = []
|
||||||
journal_papers.each do |journal_paper|
|
journal_papers.each do |journal_paper|
|
||||||
|
@ -48,7 +49,7 @@ class PersonalJournalsController < ApplicationController
|
||||||
end
|
end
|
||||||
journal_paper_list << {"jps" => t}
|
journal_paper_list << {"jps" => t}
|
||||||
end
|
end
|
||||||
end
|
|
||||||
headers = []
|
headers = []
|
||||||
choice_show = []
|
choice_show = []
|
||||||
fields_to_show.each do |fs|
|
fields_to_show.each do |fs|
|
||||||
|
@ -73,6 +74,10 @@ class PersonalJournalsController < ApplicationController
|
||||||
"url" => "/"+params[:locale]+params[:url],
|
"url" => "/"+params[:locale]+params[:url],
|
||||||
"all" => journal_papers_temp
|
"all" => journal_papers_temp
|
||||||
}
|
}
|
||||||
|
end
|
||||||
|
{
|
||||||
|
"all" => journal_papers_show
|
||||||
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|
Loading…
Reference in New Issue