Module: ResponsiveImageTag

Defined in:
lib/responsive_image_tag.rb,
lib/generators/responsive_image_tag/jquery_generator.rb,
lib/generators/responsive_image_tag/prototype_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.



9
10
11
12
13
14
15
16
# File 'lib/responsive_image_tag.rb', line 9

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(small, options)
  output += tag "/noscript", nil, true
  output
end