diff --git a/app/helpers/ems_infra_helper.rb b/app/helpers/ems_infra_helper.rb index d245d12348de..e74545545e5e 100644 --- a/app/helpers/ems_infra_helper.rb +++ b/app/helpers/ems_infra_helper.rb @@ -21,4 +21,8 @@ def scaling_field_label(param_name) _("Number of %{host_type} Hosts") % {:host_type => field_name.underscore.humanize.titleize} end end + + def edit_redirect_path(lastaction, ems) + lastaction == 'show_list' ? ems_infras_path : ems_infra_path(ems) + end end diff --git a/app/views/ems_infra/edit.html.haml b/app/views/ems_infra/edit.html.haml index 4431c2cc4a34..e77171469231 100644 --- a/app/views/ems_infra/edit.html.haml +++ b/app/views/ems_infra/edit.html.haml @@ -1,3 +1,5 @@ += react('ProviderForm', :providerId => @ems.id.to_s, :redirect => edit_redirect_path(@lastaction, @ems), :kind => 'infra', :title => ui_lookup(:model => 'ManageIQ::Providers::InfraManager')) + = form_for(@ems, :url => ems_infra_path(@ems), :method => :patch, diff --git a/app/views/ems_infra/new.html.haml b/app/views/ems_infra/new.html.haml index bc1fd2fe3a4c..7320da2acd9a 100644 --- a/app/views/ems_infra/new.html.haml +++ b/app/views/ems_infra/new.html.haml @@ -1,3 +1,5 @@ += react('ProviderForm', :redirect => ems_infras_path, :kind => 'infra', :title => ui_lookup(:model => 'ManageIQ::Providers::InfraManager')) + - url = @ems.persisted? ? ems_infras_path(@ems) : ems_infras_path = form_for(@ems, :url => url,