Skip to content

Instantly share code, notes, and snippets.

@kenmickles
Last active December 14, 2015 07:59
Show Gist options
  • Save kenmickles/5054196 to your computer and use it in GitHub Desktop.
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
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