Pictures out from images folder

Hi!!!
I wanna to show in my web page a picture, but this picture I can´t move
it from the folder where it is. I know that in Rails you have to have
the picture in the images folder, but I wanna to know if it is possible
to show a picture from another folder different.

Thanks!!

On Jan 15, 1:49Â pm, Guille S. [email protected] wrote:

Hi!!!
I wanna to show in my web page a picture, but this picture I can´t move
it from the folder where it is. I know that in Rails you have to have
the picture in the images folder, but I wanna to know if it is possible
to show a picture from another folder different.

public/images is the usual place to put images but anywhere within the
public folder will do (since that is what your document root is). With
extra configuration you can probably get your webserver to serve
images from other locations too.

Fred

Frederick C. wrote:

On Jan 15, 1:49Â pm, Guille S. [email protected] wrote:

Hi!!!
I wanna to show in my web page a picture, but this picture I can´t move
it from the folder where it is. I know that in Rails you have to have
the picture in the images folder, but I wanna to know if it is possible
to show a picture from another folder different.

public/images is the usual place to put images but anywhere within the
public folder will do (since that is what your document root is). With
extra configuration you can probably get your webserver to serve
images from other locations too.

Fred

Ok, but I´m newie in RoR, how can I do that??

Thanks

Sure it is possible and you have many options how to reach it. The
easiest way is probably to make a filesystem link from Rails image
folder to your unmovable folder. Like (provided you are in your rails
public/images directory)

ln -s /your/unmovable

and you can reach your images like this

image_tag ‘unmovable/something.png’

cheers

Jakub

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs