Skip to content

Instantly share code, notes, and snippets.

@rafaelss
Created May 24, 2010 12:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafaelss/411798 to your computer and use it in GitHub Desktop.
Save rafaelss/411798 to your computer and use it in GitHub Desktop.
def test_array_of_arrays
template = <<template
{{#items}}
start
{{#map}}
{{a}}
{{/map}}
end
{{/items}}
template
data = {
"items" => [
[ {"a" => 1}, {"a" => 2}, {"a" => 3} ],
[ {"a" => 4}, {"a" => 5}, {"a" => 6} ],
[ {"a" => 7}, {"a" => 8}, {"a" => 9} ]
]
}
assert_equal <<expected, Mustache.render(template, data)
start
1
2
3
end
start
4
5
6
end
start
7
8
9
end
expected
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment