show gear image when no thumbnail URL present
Okay, surprise, the bug was unrelated to Camo config (though I'm glad I cleaned that up anyway :P). We now, at a low level, serve a placeholder image for item thumbnail URL if, for some reason, we don't have a good thumbnail URL on hand.
This commit is contained in:
parent
f54683464f
commit
daa831e2b0
2 changed files with 7 additions and 1 deletions
BIN
app/assets/images/broken_item_thumbnail.gif
Normal file
BIN
app/assets/images/broken_item_thumbnail.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
|
@ -328,7 +328,13 @@ class Item < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def thumbnail
|
||||
@thumbnail ||= Image.from_insecure_url(thumbnail_url)
|
||||
if thumbnail_url.present?
|
||||
url = thumbnail_url
|
||||
else
|
||||
url = ActionController::Base.helpers.asset_path(
|
||||
"broken_item_thumbnail.gif")
|
||||
end
|
||||
@thumbnail ||= Image.from_insecure_url(url)
|
||||
end
|
||||
|
||||
def as_json(options={})
|
||||
|
|
Loading…
Reference in a new issue