Class: Picture

Inherits:
Document
  • Object
show all
Defined in:
app/models/picture.rb

Constant Summary

Constants inherited from Document

Document::IMAGE_FORMATS

Instance Method Summary collapse

Methods inherited from Document

#format, #mime_type, new

Instance Method Details

#thumb(size, helper) ⇒ Object

Thumbnail file



18
19
20
21
22
23
24
25
26
27
# File 'app/models/picture.rb', line 18

def thumb(size, helper)
  case size
    when 16
      "#{ size.to_s }/photo.png"
    when 48
      helper.picture_path self, :format => format, :style => 'thumb'   
    when 130
      helper.picture_path self, :format => format, :style => 'thumb0'    
  end
end