app/models/attachment.rb
# Returns a URL to a small thumbnail image.
# Falls back on a placeholder image if thumbnail generation is not supported
# for this type of attachment.
#
# @param size [String] a size as accepted by ImageMagick. See
#   http://markevans.github.io/dragonfly/imagemagick/ for reference.
#
# @return [String] a thumbnail or placeholder URL
Returns a URL to a small thumbnail image.
Falls back on a placeholder image if thumbnail generation is not supported
for this type of attachment.
Returns a URL to a small thumbnail image . Falls back on a placeholder image if thumbnail generation is not supported for this type of attachment .
def thumb (size = '80x80#')
    if web_image?
      Dragonfly.app.fetch_url(access_url).thumb(size).url
    else
      'http://placehold.it/40?text=No+Image';
    end
  end
def thumb ( size = '80x80#' ) if web_image? Dragonfly . app . fetch_url ( access_url ) . thumb ( size ) . url else 'http://placehold.it/40?text=No+Image' ; end end
Returns a URL to a small thumbnail image.
Returns a URL to a small thumbnail image .
# Although Dragonfly is not thread-safe, since this operation likely has # no side-effects, we don't place it within a critical section. # TODO Ensure Dragonfly processing works with multiple threads
a thumbnail or placeholder URL
a thumbnail or placeholder URL
String
size
a size as accepted by ImageMagick.
a size as accepted by ImageMagick .