diff --git a/app/controllers/admin/site_panel_controller.rb b/app/controllers/admin/site_panel_controller.rb index 384b82a..219a488 100644 --- a/app/controllers/admin/site_panel_controller.rb +++ b/app/controllers/admin/site_panel_controller.rb @@ -11,6 +11,7 @@ class Admin::SitePanelController < OrbitAdminController super @app_title = "client_management" end + Is_Rails5 = (Rails.version.to_i > 4) def can_use ClientManagerSetting.create if ClientManagerSetting.count == 0 setting = ClientManagerSetting.first @@ -52,7 +53,11 @@ class Admin::SitePanelController < OrbitAdminController setting_params = params.require(:client_manager_setting).permit! setting = ClientManagerSetting.first setting.update_attributes(setting_params) - redirect_to :back + if Is_Rails5 + redirect_back(fallback_location: { action: "setting"}) + else + redirect_to :back and return + end end def upload_cert @site_cert = SiteCert.new @@ -294,7 +299,11 @@ class Admin::SitePanelController < OrbitAdminController redirect_to admin_site_panel_edit_site_path(:id=>params[:id],:type=>'detail',:status=>'changing') and return elsif params[:type] == 'delete_from_list' SiteConstruct.find(params[:id]).destroy - redirect_to :back and return + if Is_Rails5 + redirect_back(fallback_location: { action: "sites_list"}) + else + redirect_to :back and return + end elsif params[:type] == 'select_cert' is_certbot = true if params[:server_names] diff --git a/app/views/admin/site_panel/_form.html.erb b/app/views/admin/site_panel/_form.html.erb index f22cb16..bc6df87 100644 --- a/app/views/admin/site_panel/_form.html.erb +++ b/app/views/admin/site_panel/_form.html.erb @@ -138,10 +138,13 @@ }