you are here: codestackercodes [RSS] → tag paperclip [RSS]

paperclip refresh all images

run this task

rake paperclip:refresh class=MyClass

paperclip ie validation

validates_attachment_content_type :image,
  :content_type => [
    'image/jpeg',
    'image/pjpeg', # for progressive jpeg (IE mine-type for regular jpeg) 

    'image/png',
    'image/x-png', # IE mine-type for PNG

    'image/gif'
]

paperclip running in passenger

it's necessary set the correct path of imagemagick. in os x (dev) e linux (production):

if RAILS_ENV == "development" 
  Paperclip.options[:image_magick_path] = '/opt/local/bin/' 
else 
  Paperclip.options[:image_magick_path] = '/usr/bin/' 
end 
Displaying all 3 Code