Created
July 17, 2015 12:59
-
-
Save carloscortegagna/0b6b0fc7500dcc9ff678 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 ApplicationHelper | |
include ActionView::Helpers::AssetTagHelper | |
def image_tag(source, options = {}) | |
if options[:retina] | |
options['data-at2x'] = path_to_image(source.split('.').join('@2x.')) | |
options.tap { |h| h.delete(:retina) } | |
else | |
options['data-no-retina'] = '' | |
end | |
super(source, options) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment