Module: Locomotive::Extensions::Asset::Vignette

Included in:
ContentAsset
Defined in:
app/models/locomotive/extensions/asset/vignette.rb

Instance Method Summary collapse

Instance Method Details

#vignette_urlObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/models/locomotive/extensions/asset/vignette.rb', line 6

def vignette_url
  if self.image?
    if self.width < 85 && self.height < 85
      self.source.url
    else
      Locomotive::Dragonfly.resize_url(self.source, '85x85#')
    end
  elsif self.pdf?
    Locomotive::Dragonfly.thumbnail_pdf(self.source, '85x85#')
  end
end