Created
September 19, 2010 10:52
-
-
Save toolmantim/586657 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # An example of rolling your own simple content_for helper in Sinatra | |
| helpers do | |
| def content_for(key, &block) | |
| @content ||= {} | |
| @content[key] = capture_haml(&block) | |
| end | |
| def content(key) | |
| @content && @content[key] | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment