Paperclip Default Url Missing.Png Location

Posted by Weston Ganger

I thought this was kind of confusing and not well documented. All I wanted to do was make a quick and easy missing.png file in app/assets/images/ and have that be the no-file image. Turned out I needed to change the default_url in the posts model at the end of the line has_attachment

I changed it to this to use my one single image, app/assets/images/missing.png:


has_attached_file :image1, 
  :styles => { :medium => "300x300>", :thumb => "150x150>" },
  :default_url => "missing.png"

Article Topic:Software Development - Rails

Date:July 07, 2014

Recommended Posts