From dd67af744d92bb44df0a3d0c4e03c6913c485850 Mon Sep 17 00:00:00 2001 From: bohung Date: Tue, 17 Nov 2020 21:55:15 +0800 Subject: [PATCH] Fix announcement page error. --- app/controllers/admin/announcements_controller.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/announcements_controller.rb b/app/controllers/admin/announcements_controller.rb index e150c5d..a5456a4 100644 --- a/app/controllers/admin/announcements_controller.rb +++ b/app/controllers/admin/announcements_controller.rb @@ -244,7 +244,7 @@ class Admin::AnnouncementsController < OrbitAdminController bulletin.save build_email(bulletin,I18n.locale) create_feed_cache(bulletin) - redirect_to params['referer_url'] + redirect_to admin_announcements_path end def approve_bulletin @@ -324,19 +324,19 @@ class Admin::AnnouncementsController < OrbitAdminController now_bulletin_page = Bulletin.where(:title.ne => "",:is_preview.in=>[false,nil]) .order_by(sort).map(&:id).map.with_index.select{|v,i| v==bulletin.id}[0][1] rescue nil now_bulletin_page = now_bulletin_page.nil? ? 0 : ((now_bulletin_page+1).to_f/10).ceil - redirect_to "/zh_tw/admin/announcements?page=#{now_bulletin_page}" + redirect_to admin_announcements_path(:page=>now_bulletin_page) end def destroy @bulletin.destroy - redirect_to "/admin/announcements" + redirect_to admin_announcements_path end def delete if params[:ids] Bulletin.any_in(:uid => params[:ids]).destroy_all end - redirect_to "/admin/announcements" + redirect_to admin_announcements_path end def preview