开发者

How can I serve static content from outside of the project - rails

Without using a symlink, how can I serve images that ar开发者_开发百科e outside of the rails project? I though there might be some routes magic but I can find what I'm looking for...

Lets say images are at ~/images and the application is at ~/app.


I think the ~/images is going to screw you up. Images becomes the public/images folder. However, if you were to name it ~/static_images then you could:

=image_tag("/static_images/my_cool_graph.png")

Alternatively, you could host ~/images in a vhost... so if you were http://joe.com then you could:

=image_tag("http://static.joe.com/images/my_cool_graph.png")
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜