Created
April 8, 2014 18:57
-
-
Save pwfisher/10171356 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
Ember.Handlebars.helper 'image', (path, options) -> | |
attrs = for key, value of options.hash when typeof value is 'string' then "#{key}=\"#{value}\"" | |
attrs.unshift 'src="//example.com/assets/' + path + '"' | |
new Handlebars.SafeString '<img ' + (attrs.join ' ') + '>' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment