From 591a3e0bc4ddd80310cbd633b52afa4ee9c216f7 Mon Sep 17 00:00:00 2001 From: saurabhbhatia Date: Wed, 6 Nov 2013 17:20:40 +0800 Subject: [PATCH] Updated redirect path after saving a page --- app/controllers/admin/page_parts_controller.rb | 4 +--- app/views/admin/page_parts/update.js.erb | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 app/views/admin/page_parts/update.js.erb diff --git a/app/controllers/admin/page_parts_controller.rb b/app/controllers/admin/page_parts_controller.rb index 2ca71341..d7b11404 100644 --- a/app/controllers/admin/page_parts_controller.rb +++ b/app/controllers/admin/page_parts_controller.rb @@ -95,9 +95,7 @@ class Admin::PagePartsController < OrbitBackendController set_children_sub_menu(@part) if @part.public_r_tag && @part.public_r_tag.eql?('sub_menu') flash.now[:notice] = t('update.success.content') respond_to do |format| - format.html { - redirect_to admin_page_url(@part.page, edit: true) - } + format.js end else @id = params[:id] diff --git a/app/views/admin/page_parts/update.js.erb b/app/views/admin/page_parts/update.js.erb new file mode 100644 index 00000000..62ee749f --- /dev/null +++ b/app/views/admin/page_parts/update.js.erb @@ -0,0 +1 @@ +window.location.href="<%= admin_page_url(@part.page, edit: true) %>" \ No newline at end of file