Skip to content

Instantly share code, notes, and snippets.

@appleton
Created April 26, 2012 11:45
Show Gist options
  • Save appleton/2499061 to your computer and use it in GitHub Desktop.
Save appleton/2499061 to your computer and use it in GitHub Desktop.
Conditional comparison for Handlebars
Handlebars.registerHelper 'if_equal', (val1, val2, fn) ->
if val1 == val2
return fn()
else if fn.inverse
return fn.inverse()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment