Is there a simpler way to do this?
What I try to do here is simply add the item hashes inside each list to myarray
myarray = []
list = [{list: [{item: 'item1'},{item: 'item2'}]}, {list: [{item: 'item3'},{item: 'item4'}]}, {list: [{item: 'item5'},{item: 'item6'}]}]
list.each do |list|
myarray = myarray + list
end
This:
produces this:
(the nil is because your last element is
I assume you meant list: just like in the others.