Skip to content

Commit

Permalink
On Cancel redirect to the last url in @breadcrumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
AparnaKarve committed May 31, 2017
1 parent c6e3ae2 commit e9792f9
Showing 1 changed file with 1 addition and 3 deletions.
Expand Up @@ -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
Expand Down

0 comments on commit e9792f9

Please sign in to comment.