If you are having trouble creating YAML, I would try to create an object in the console and then convert it to YAML to see what it looks like. For instance:
test = { :admin => [ {:action => "create", :resource => "employee"}, {:action => "show", :resource => "company"} ] } test.to_yaml => "--- \n:admin: \n- :action: create\n :resource: employee\n- :action: show\n :resource: company\n"
You can even output it to a file if it makes your life easier:
File.open('test.yaml', 'w') do |out| out.write(test.to_yaml) end
What gives:
--- :admin: - :action: create :resource: employee - :action: show :resource: company
I did not quite understand what you have, because I used the characters for the keys, but this should help you, I hope.
source share