Created
March 25, 2013 13:40
-
-
Save stoodder/5237170 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
| #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