Rails missing image

二次信任 提交于 2019-12-03 22:29:37
DanneManne

If you don't need any control over the default image, which I don't think you need, you can place it in any folder under RAILS_ROOT/public/images/

Just make sure you point it out in the attachment model with the :default_url parameter. So for example if you place the image in RAILS_ROOT/public/images/normal/missing.png you need t specify the path like this:

has_attached_file :photo, :default_url => "/images/normal/missing.png"
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!