Revision 4ef5bacc
Added by Marc Dequènes almost 14 years ago
- ID 4ef5bacc0c50575e64b8f6302e1a385043656441
app/helpers/application_helper.rb | ||
---|---|---|
table.content [_("Updated at:"), obj.updated_at]
|
||
end
|
||
|
||
def display_thumbnail(img, thumb_name = nil)
|
||
def display_thumbnail(img, size_name = nil)
|
||
return if img.nil?
|
||
|
||
if not img.exists?
|
||
return "<span class='error'>" + _("Missing Image !") + "</span>"
|
||
end
|
||
|
||
thumb = img.thumbnail(thumb_name)
|
||
thumb = img.thumbnail(size_name)
|
||
if thumb.nil?
|
||
"<span class='error'>" + _("Missing Thumbnail !") + "</span>"
|
||
else
|
||
image_tag(img.public_filename(thumb_name))
|
||
image_tag(img.public_filename(size_name))
|
||
end
|
||
end
|
||
|
Also available in: Unified diff
[fix] ensure the default display size for a thumbnail (currently the full image) does not crash (closes #77)