Module: Foreman::Controller::HostDetails

Included in:
HostgroupsController, HostsController
Defined in:
lib/foreman/controller/host_details.rb

Overview

This module extract repeating methods which handle host assoications of hostgroups, os etc Mainly used within the host and the hostgroup controllers

Instance Method Summary collapse

Instance Method Details

#architecture_selectedObject


6
7
8
# File 'lib/foreman/controller/host_details.rb', line 6

def architecture_selected
  assign_parameter "architecture", "common/os_selection/"
end

#domain_selectedObject


19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/foreman/controller/host_details.rb', line 19

def domain_selected
  respond_to do |format|
    format.html {assign_parameter "domain", "common/"}
    format.json do
      taxonomy_scope
      Taxonomy.as_taxonomy @organization, @location do
        if (domain = Domain.find(params[:domain_id]))
          render :json => domain.subnets
        else
          not_found
        end
      end
    end
  end
end

#medium_selectedObject


14
15
16
17
# File 'lib/foreman/controller/host_details.rb', line 14

def medium_selected
  # Maybe this method can be folded into assign_parameter
  render :partial => "common/os_selection/image_details", :locals => { :item => item_object }
end

#os_selectedObject


10
11
12
# File 'lib/foreman/controller/host_details.rb', line 10

def os_selected
  assign_parameter "operatingsystem", "common/os_selection/"
end

#use_image_selectedObject


35
36
37
38
# File 'lib/foreman/controller/host_details.rb', line 35

def use_image_selected
  item = item_object
  render :json => {:use_image => item.use_image, :image_file => item.image_file}
end