Module: CaptureAPI::ViewHelpers

Defined in:
lib/captureapi/view_helpers.rb

Instance Method Summary collapse

Instance Method Details

#thumbnail_tag(url, options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/captureapi/view_helpers.rb', line 3

def thumbnail_tag(url, options = {})
  options.symbolize_keys!

  options[:width] ||= 200
  options[:height] ||= 200
  options[:alt] ||= "Thumbnail of #{url}"

  thumbnail_options = {
    :width  => options[:width],
    :height => options[:height]
  }

  image_tag(CaptureAPI::API::thumbnail_uri(url, thumbnail_options), options)
end