diff --git a/app/controllers/admin/application_forms_controller.rb b/app/controllers/admin/application_forms_controller.rb index a5beee5..9550e2a 100644 --- a/app/controllers/admin/application_forms_controller.rb +++ b/app/controllers/admin/application_forms_controller.rb @@ -1,6 +1,6 @@ # encoding: utf-8 class Admin::ApplicationFormsController < OrbitAdminController - + Is_Rails5 = (Rails::VERSION::MAJOR >= 5) require 'axlsx' include Admin::ApplicationFormsHelper helper Admin::ApplicationFormsFieldHelper @@ -603,7 +603,20 @@ class Admin::ApplicationFormsController < OrbitAdminController @application_form.update_user_id = current_user.id if @application_form.update_attributes(@application_form_params) @application_form.application_form_signup_fields.each{|t| t.destroy if t["to_delete"] == true} - redirect_to params['referer_url'] and return + if params['referer_url'].blank? + fallback_location = admin_application_forms_path + if Is_Rails5 + redirect_back(fallback_location: fallback_location) and return + else + begin + redirect_to :back and return + rescue + redirect_to fallback_location and return + end + end + else + redirect_to params['referer_url'] and return + end else flash.now[:error] = t('update.error.category') render action: :edit and return diff --git a/app/views/admin/application_forms/_form.html.erb b/app/views/admin/application_forms/_form.html.erb index 9721a91..782d4c3 100644 --- a/app/views/admin/application_forms/_form.html.erb +++ b/app/views/admin/application_forms/_form.html.erb @@ -377,7 +377,6 @@