我有这个:
<% citys = { "New York" => 200, "Boston" => 300, "Miami" => 400, "Chicago" => 500, "Los Angeles" => 600, "Houston" => 700 } %>
function drawMap() {
var data = google.visualization.arrayToDataTable([
['City', 'Popularity'],
<% citys.each do |key, value| %>
[<% key %>, <% value %>],
<% end %>
]);
但它说它不被识别为有效的二维数组。这里有什么问题?