The problem I'm having is that I need to extract the value of amazon and
chef separately. Right now they are both held in the b value in my
iteration. I tried to create another loop within the value.each but i'm
getting an error. How do I efficiently extract both value separately and
efficiently?

any help would be greatly appreciated.

I'm getting my hash from a yaml file this way

require 'yaml'
path = File.join(Rails.root, 'config', 'stage-aws-opscode.yml')
SAO = YAML.load_file(path)
The stage-aws-opscode.yml contains the following data

sandbox: &defaults
  amazon: aws-green
  chef: mdsol

validation:
  <<: *defaults

cruise:
  <<: *defaults

hendricks:
  <<: *defaults

distro:
  <<: *defaults

performance:
  <<: *defaults

innovate:
  amazon: aws-red
  chef: mdsol-production

production:
  amazon: aws-red
  chef: mdsol-production


this is my iteration.

<%
 SAO.each do |key, value|
 parent = "#{key}"
  value.each do |a, b|
   "#{a}"  "#{b}"
  end
end
    %>

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to