So I have a 2D array like so
$array = [foo,bar,baz], [1,2,3]
I need to display these items in a table but cannot figure out how to do it.
$array.each do | x, y |
puts x
puts y
end
^^ Doesnt work, surely im missing something very simple.
Thanks for your help
array = [[:foo,:bar,:baz], [1,2,3]]
array.each do |row|
row.each { |entry| puts entry }
end
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments