Skip to content

Instantly share code, notes, and snippets.

@cwsaylor
Created October 15, 2016 04:27
Show Gist options
  • Save cwsaylor/94e0a10b2d4da8997d48275a483a379c to your computer and use it in GitHub Desktop.
Save cwsaylor/94e0a10b2d4da8997d48275a483a379c to your computer and use it in GitHub Desktop.
module InterchangeHelper
def retina_image_tag(default_name, options={})
retina_name = default_name.gsub(%r{\.\w+$}, '@2x\0')
image_tag(default_name, options.merge('data-interchange' => "[#{asset_path(retina_name)}, (retina)]"))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment