diff --git a/app/controllers/admin/journal_papers_controller.rb b/app/controllers/admin/journal_papers_controller.rb index 9c656fc..098cff4 100644 --- a/app/controllers/admin/journal_papers_controller.rb +++ b/app/controllers/admin/journal_papers_controller.rb @@ -47,7 +47,14 @@ class Admin::JournalPapersController < OrbitMemberController end end def index - @writing_journals = JournalPaper.sort_year_date.page(params[:page]).per(10) + @writing_journals = JournalPaper.sort_year_date + if params[:keywords] + @writing_journals = search_data(@writing_journals,[:slug_title]) + end + @writing_journals = @writing_journals.page(params[:page]).per(10) + if request.xhr? + render :partial => "writing_journal" + end end def new diff --git a/app/views/admin/journal_papers/index.html.erb b/app/views/admin/journal_papers/index.html.erb index bf1d22f..7572e16 100644 --- a/app/views/admin/journal_papers/index.html.erb +++ b/app/views/admin/journal_papers/index.html.erb @@ -4,6 +4,7 @@ function MergeUrl(){ location.href = '<%= merge_admin_journal_papers_path %>' } +<%= render_filter nil, "tbody_writing_journals" %>