theforeman/foreman-xen

View on GitHub
app/views/compute_resources_vms/form/_hypervisors.html.erb

Summary

Maintainability
Test Coverage
<div id='hypervisor_selection'>
  <%= selectable_f_with_cache_invalidation(f, :hypervisor_host,
        options_from_collection_for_select(
          compute_resource.available_hypervisors, :uuid, :display_name
        ),
        { include_blank: 'Automatic allocation' },
        { class: "span2",
          disabled: (controller_name != 'hosts'),
          label: _("Hypervisor"), },
        { title: 'Refresh available hypervisors',
          url: url_for(controller: "foreman_xen/cache",
                       action: "refresh", only_path: true),
          compute_resource_id: compute_resource.id,
          attribute: 'available_hypervisors' }
      ) %>
</div>