I have the following ruby hash:
values = [ {"FA1": [{"Act 1": "A"},{"Act 2": "A"}] } ]
I need to iterate through the values array to get a string like this
cells = "[Act 1 A],[Act 2 B]"
Currently, I am trying this :
values[0]['FA1'].each do |key, val|
cells = [#{key} #{val}]
end
which gives me the value of
#{key} as Act 1 A and #{val} as empty
And how can I append these values to a variable separated by a ‘,’?
It’s weird but anyway…
This will generate: