Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

document hash shortcut

  • Loading branch information...
commit 4f19541824502e45ce33f916a6760cb1994cce3f 1 parent 41ce3ac
@defunkt defunkt authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 README.md
View
18 README.md
@@ -144,6 +144,24 @@ And this view code:
When rendered, our view will contain a list of all repository names in
the database.
+As a convenience, if a section returns a hash (as opposed to an array
+or a boolean) it will be treated as a single item array.
+
+With the above template, we could use this Ruby code for a single
+iteration:
+
+ def repo
+ { :name => Repository.first.to_s }
+ end
+
+This would be treated by Mustache as functionally equivalent to the
+following:
+
+ def repo
+ [ { :name => Repository.first.to_s } ]
+ end
+
+
### Comments
Comments begin with a bang and are ignored. The following template:
Please sign in to comment.
Something went wrong with that request. Please try again.