Module: ForemanCustomTab::HostsHelper

Defined in:
app/helpers/foreman_custom_tab/hosts_helper.rb

Instance Method Summary collapse

Instance Method Details

#summary_fields(host) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'app/helpers/foreman_custom_tab/hosts_helper.rb', line 3

def summary_fields(host)
  require 'yaml'
  rows = YAML.load_file('config/tab.yaml')

  fields = []
  rows.each do |a, b|
    fields += [[_(a), host.send(b)]] if host.send(b).present?
  end
  fields
end