Skip to content

Instantly share code, notes, and snippets.

@stoodder
Created March 25, 2013 13:40
Show Gist options
  • Save stoodder/5237170 to your computer and use it in GitHub Desktop.
Save stoodder/5237170 to your computer and use it in GitHub Desktop.
#Helper for Handlebars
def hb(expression, &block)
if block
#Used for block format -hb("if testing") do ...
haml_concat( "{{##{expression}}}" )
tab_up
block.call
tab_down
haml_concat( "{{/#{expression.split[0]}}}" )
else
#Used for string output format =hb("testing") or ="#{hb 'testing'}"
return "{{#{expression}}}"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment