From 0c0e251cd0168b8b2b8cee8201c008640f9bfaa0 Mon Sep 17 00:00:00 2001 From: BoHung Chiu Date: Fri, 14 Jul 2023 19:01:34 +0800 Subject: [PATCH] Fix bug. --- app/controllers/admin/journal_papers_controller.rb | 2 +- app/views/admin/journal_papers/index.html.erb | 2 +- app/views/admin/journal_papers/index.js.erb | 3 --- app/views/admin/journal_papers/index_js.html.erb | 4 ++++ 4 files changed, 6 insertions(+), 5 deletions(-) delete mode 100644 app/views/admin/journal_papers/index.js.erb create mode 100644 app/views/admin/journal_papers/index_js.html.erb diff --git a/app/controllers/admin/journal_papers_controller.rb b/app/controllers/admin/journal_papers_controller.rb index 098cff4..941faeb 100644 --- a/app/controllers/admin/journal_papers_controller.rb +++ b/app/controllers/admin/journal_papers_controller.rb @@ -53,7 +53,7 @@ class Admin::JournalPapersController < OrbitMemberController end @writing_journals = @writing_journals.page(params[:page]).per(10) if request.xhr? - render :partial => "writing_journal" + render "index_js", :layout => false end end diff --git a/app/views/admin/journal_papers/index.html.erb b/app/views/admin/journal_papers/index.html.erb index 7572e16..0c876ea 100644 --- a/app/views/admin/journal_papers/index.html.erb +++ b/app/views/admin/journal_papers/index.html.erb @@ -42,7 +42,7 @@ function MergeUrl(){ <%= link_to content_tag(:i, nil, :class => 'icon-cog icon-white') + t('setting'), admin_writing_journal_setting_path, :class => 'btn btn-primary pull-right' %> <% if params[:error] == "1" %> diff --git a/app/views/admin/journal_papers/index.js.erb b/app/views/admin/journal_papers/index.js.erb deleted file mode 100644 index 6218673..0000000 --- a/app/views/admin/journal_papers/index.js.erb +++ /dev/null @@ -1,3 +0,0 @@ -$("#sort_headers").html("<%= j render 'sort_headers' %>"); -$("#tbody_writing_journals").html("<%= j render :partial => 'writing_journal', :collection => @writing_journals %>"); -$("#writing_journal_pagination").html("<%= j paginate @writing_journals, :params => {:direction => params[:direction], :sort => params[:sort], :filter => @filter, :new_filter => nil} %>"); \ No newline at end of file diff --git a/app/views/admin/journal_papers/index_js.html.erb b/app/views/admin/journal_papers/index_js.html.erb new file mode 100644 index 0000000..e1d7073 --- /dev/null +++ b/app/views/admin/journal_papers/index_js.html.erb @@ -0,0 +1,4 @@ + \ No newline at end of file