Skip to content

Commit

Permalink
Merge pull request #305 from AparnaKarve/storage_vm_and_host_associat…
Browse files Browse the repository at this point in the history
…ions_gh_issue_243

Storage: Fixed the process_button method to render the page correctly
  • Loading branch information
Dan Clarizio committed Aug 6, 2014
2 parents 8964330 + 5552423 commit 681fee3
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions vmdb/app/controllers/cim_instance_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,17 @@ def process_button
"#{pfx}_retire","#{pfx}_protect","#{pfx}_ownership","#{pfx}_right_size",
"#{pfx}_refresh", "#{pfx}_reconfigure", "storage_tag"].include?(params[:pressed]) &&
@flash_array == nil

if !["host_edit","#{pfx}_edit","#{pfx}_miq_request_new","#{pfx}_clone","#{pfx}_migrate","#{pfx}_publish"].include?(params[:pressed])
@refresh_div = "main_div"
@refresh_partial = "layouts/gtl"
show # Handle EMS buttons
end
end
params[:page] = @current_page if @current_page.present? # Save current page for list refresh
unless ["host_edit",
"#{pfx}_edit",
"#{pfx}_miq_request_new",
"#{pfx}_clone",
"#{pfx}_migrate",
"#{pfx}_publish"].include?(params[:pressed])
@refresh_div = "main_div"
@refresh_partial = "layouts/gtl"
show # Handle EMS buttons
end
else
tag(self.class.model) if params[:pressed] == button_name("tag")
Expand Down Expand Up @@ -115,7 +120,8 @@ def process_button
else
if ["vms","hosts","storages"].include?(@display) # If displaying vms, action_url s/b show
page << "miqReinitToolbar('center_tb');"
page.replace_html("main_div", :partial=>"layouts/gtl", :locals=>{:action_url=>"show/#{@ems.id}"})
page.replace_html("main_div", :partial => "layouts/gtl",
:locals => {:action_url => "show/#{@record.id}"})
else
page.replace_html(@refresh_div, :partial=>@refresh_partial)
end
Expand Down

0 comments on commit 681fee3

Please sign in to comment.