app/controllers/cloud_tenant_controller.rb
# handle buttons pressed on the button bar
handle buttons pressed on the button bar
handle buttons pressed on the button bar
def button
    @edit = session[:edit]                                  
    params[:display] = @display if %w(vms instances images).include?(@display)
    params[:page] = @current_page unless @current_page.nil?   
    return tag("CloudTenant") if params[:pressed] == 'cloud_tenant_tag'
    if params[:pressed].starts_with?("vm_", 
                                     "miq_template_",
                                     "guest_",
                                     "image_",
                                     "instance_")
      pfx = pfx_for_vm_button_pressed(params[:pressed])
      process_vm_buttons(pfx)
      return if ["#{pfx}_policy_sim", "#{pfx}_compare", "#{pfx}_tag", "#{pfx}_retire",
                 "#{pfx}_protect", "#{pfx}_ownership", "#{pfx}_refresh", "#{pfx}_right_size",
                 "#{pfx}_reconfigure"].include?(params[:pressed]) &&
                @flash_array.nil?
      unless ["#{pfx}_edit", "#{pfx}_miq_request_new", "#{pfx}_clone",
              "#{pfx}_migrate", "#{pfx}_publish"].include?(params[:pressed])
        @refresh_div = "main_div"
        @refresh_partial = "layouts/gtl"
        show
      end
    end
    render_button_partial(pfx)
  end
def button @edit = session [ :edit ] params [ :display ] = @display if %w( vms instances images ) . include? ( @display ) params [ :page ] = @current_page unless @current_page . nil? return tag ( "CloudTenant" ) if params [ :pressed ] == 'cloud_tenant_tag' if params [ :pressed ] . starts_with? ( "vm_" , "miq_template_" , "guest_" , "image_" , "instance_" ) pfx = pfx_for_vm_button_pressed ( params [ :pressed ] ) process_vm_buttons ( pfx ) return if [ "#{pfx}_policy_sim" , "#{pfx}_compare" , "#{pfx}_tag" , "#{pfx}_retire" , "#{pfx}_protect" , "#{pfx}_ownership" , "#{pfx}_refresh" , "#{pfx}_right_size" , "#{pfx}_reconfigure" ] . include? ( params [ :pressed ] ) && @flash_array . nil? unless [ "#{pfx}_edit" , "#{pfx}_miq_request_new" , "#{pfx}_clone" , "#{pfx}_migrate" , "#{pfx}_publish" ] . include? ( params [ :pressed ] ) @refresh_div = "main_div" @refresh_partial = "layouts/gtl" show end end render_button_partial ( pfx ) end
handle buttons pressed on the button bar
handle buttons pressed on the button bar
# Restore @edit for adv search box # Save current page for list refresh # Handle buttons from sub-items screen