我正在使用蜻蜓,並希望有一個默認圖像,以縮略圖的相同方式調整大小。蜻蜓寶石 - 默認圖片?
我目前有以下代碼,但是當Dragonfly使用fetch_file方法時,它會嘗試處理縮略圖,但生成的URL是無效鏈接。
if listing.image
image = listing.image.jpg
else
image = Dragonfly[:images].fetch_file('/toekomst/images/speech-bubble.png')
end
image_tag image.jpg.thumb(size).url, :class => "framed"
我找不到對此的很多幫助,所以任何提示都非常感謝!謝謝!
似乎有一個默認選項現在:HTTP:// markevans .github.io /蜻蜓/模型/#默認內容 – Chloe