Serving images from public folder when using asset pipeline Rails 3.2

≡放荡痞女 提交于 2019-12-21 20:43:33

问题


I am using Rails 3.2 asset pipeline to serve my assets(images, javascript. css).

I have added paperclip for photo uploads. paperclip by default stores files in public/system

When I use the url generated by paperclip which is something like

/system/users/avatar/000/000/thumb/whatever.jpg

It gives me no route error. the file is there at the above location but I think it may be issue with asset pipleline.

Any ideas what might be going wrong ?


回答1:


just like user451893 said. you should configure your web-server (nginx, apache etc) to deliver all static assets!

in case you don't, then you need to turn on static asset serving in rails:

config.serve_static_assets = true

have a look at this issue for more details https://github.com/thoughtbot/paperclip/issues/667



来源:https://stackoverflow.com/questions/11073650/serving-images-from-public-folder-when-using-asset-pipeline-rails-3-2

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