Rails

Paperclip Default Url Missing.Png Location

Posted by Weston Ganger on July 07, 2014

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"

Posted in Rails and Tagged with paperclip rails 


Need help on your next project or application?

I specialize in Ruby-on-Rails, AngularJS, Javascript, Bootstrap, and Hybrid Mobile Apps with Cordova & Ionic.

Contact Me

Recommended Posts