Last active
December 14, 2015 07:59
-
-
Save kenmickles/5054196 to your computer and use it in GitHub Desktop.
Rails helper method for creating image tags to use with jquery.lazyload.js
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
def lazy_image_tag(src, options = {}) | |
options["data-original"] = image_path(src) | |
options[:class] = "lazy #{options[:class]}" | |
image_tag("lazy.png", options) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment