From e9792f9f5150e782057085c70d7eb8d76fb2dc02 Mon Sep 17 00:00:00 2001 From: Aparna Karve Date: Wed, 31 May 2017 16:54:00 -0700 Subject: [PATCH] On Cancel redirect to the last url in `@breadcrumbs` https://bugzilla.redhat.com/show_bug.cgi?id=1451315 --- app/controllers/application_controller/miq_request_methods.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/application_controller/miq_request_methods.rb b/app/controllers/application_controller/miq_request_methods.rb index 6968b91b35a..4286c99fc42 100644 --- a/app/controllers/application_controller/miq_request_methods.rb +++ b/app/controllers/application_controller/miq_request_methods.rb @@ -82,9 +82,7 @@ def pre_prov if @breadcrumbs && (@breadcrumbs.empty? || @breadcrumbs.last[:url] == "/vm/show_list") javascript_redirect :action => "show_list", :controller => "vm" else - # had to get id from breadcrumbs url, because there is no params[:id] when cancel is pressed on copy Request screen. - url = @breadcrumbs.last[:url].split('/') - javascript_redirect :controller => url[1], :action => url[2], :id => url[3] + javascript_redirect @breadcrumbs.last[:url] end end elsif params[:button] == "continue" # Template chosen, start vm provisioning