views:

23

answers:

1

Without using a symlink, how can I serve images that are 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.

A: 

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")
Jesse Wolgamott
"~/images" was arbitrary, should have thought about the conflict. I should also have mentioned that this is only relevant for development servers as apache will serve the images upon deployment. What do I tell rails, and where to implement your top solution?
Joe
Hmm, if in development, then I would go with a symlink solution. Or maybe explain a little bit where these images are stored; is it possible to have a dev apache that only serves these images?
Jesse Wolgamott
Well the images are part of a different project, so I could use git submodules perhaps...
Joe