Skip to content

[NoMethodError]: undefined method `to_a' /var/www/miq/vmdb/app/models/dialog_field_sorted_item.rb:61 #22423

Closed Answered by needle2k
needle2k asked this question in Q&A
Discussion options

You must be logged in to vote

fixed it

def self.create_hash(output)
  hash = {}
  hash[nil] = "-- Select --"
  output.each_line do |x|
    y = x.gsub(/[\r\n]+/, '')
   	hash[y] = y 
  end
  return hash
end

myhash = create_hash(output.to_s)

begin
unless myhash.nil?
list_values = {
'visible' => radio_selected,
'required' => false,
'data_type' => "string",
'values' => myhash,
'default_value' => nil,
'read_only' => false
}
list_values.each do |key, value|
$evm.object[key] = value
end
end
end

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by needle2k
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant