Module: ResponsiveImageTag

Defined in:
lib/responsive_image_tag.rb,
lib/generators/responsive_image_tag/copy_js_generator.rb

Defined Under Namespace

Modules: Generators

Instance Method Summary collapse

Instance Method Details

#responsive_image_tag(small, big, options = {}) ⇒ Object

Emits the special (and somewhat ugly) markup for our responsive image tag.

NB: the @image_path@ method is a private method of the Rails asset_tag_helper.



16
17
18
19
20
21
22
23
# File 'lib/responsive_image_tag.rb', line 16

def responsive_image_tag(small, big, options = {})
  output = tag "span", {:class => "img-placeholder"}
  output += tag "/span", nil, true
  output += tag "noscript", noscript_attributes(small, big, options), true
  output += image_tag(big, options)
  output += tag "/noscript", nil, true
  output
end