Module: ActionView::Helpers::AssetTagHelper

Defined in:
lib/action_view/helpers/image_tag_helper.rb

Instance Method Summary collapse

Instance Method Details

#image_tag_with_laziness(source, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/action_view/helpers/image_tag_helper.rb', line 5

def image_tag_with_laziness(source, options={})
  options = options.symbolize_keys
  orig_options = options.dup

  options[:data] ||= {}
  options[:data][:original] = path_to_image(source)
  options[:class] ||= ""
  options[:class] << " lazy"

  output = image_tag_without_laziness('grey.gif', options)
  output << ('noscript', image_tag_without_laziness(source, orig_options))
end