Skip to content

Instantly share code, notes, and snippets.

@pwfisher
Created April 8, 2014 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pwfisher/10171356 to your computer and use it in GitHub Desktop.
Save pwfisher/10171356 to your computer and use it in GitHub Desktop.
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