Skip to content

Instantly share code, notes, and snippets.

@rafacv
Created August 20, 2010 23:01
Show Gist options
  • Select an option

  • Save rafacv/541369 to your computer and use it in GitHub Desktop.

Select an option

Save rafacv/541369 to your computer and use it in GitHub Desktop.
Contrived example of how dot-notation can avoid clashing names
context = {
:person => {
:name => "Melissa",
:friends => [
{:name => "Chris"},
{:name => "Tom"},
{:name => "PJ"}
]
}
}
Mustache.render <<-TEMPLATE, context
{{#person}}
{{name}}
------------
{{#friends}}
* {{name}} is friend of {{person.name}}
{{/friends}}
{{/person}}
TEMPLATE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment