Skip to content

Instantly share code, notes, and snippets.

@toolmantim
Created September 19, 2010 10:52
Show Gist options
  • Select an option

  • Save toolmantim/586657 to your computer and use it in GitHub Desktop.

Select an option

Save toolmantim/586657 to your computer and use it in GitHub Desktop.
# 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