Created
October 15, 2016 04:27
-
-
Save cwsaylor/94e0a10b2d4da8997d48275a483a379c to your computer and use it in GitHub Desktop.
This file contains 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
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