# Image doesn't show (rhtml path?)

**URL:** <https://www.ruby-forum.com/t/image-doesnt-show-rhtml-path/55048>\
**Category:** Rails\
**Created:** [March 16, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/image-doesnt-show-rhtml-path/55048 "2006-03-16T17:31:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [March 16, 2006, 5:31pm UTC](https://www.ruby-forum.com/t/image-doesnt-show-rhtml-path/55048/1 "2006-03-16T17:31:43Z")

</div>

Hi,

we try to show an image which is not inside the rails  
framework, and we are not able to see the image!!!  
does someone know how to do this???

our rails is installed on

/opt/rails/project1/, so inside “project1” we have all  
the rails directory like “app”, “public”, etc.)

our image is on the “/usr/images/”

so in our link on the rhtml. we use a link like:

![](), however, we  
were never able to see the image!!!

but when we put the image inside the rails framework,  
we is able to see the image??

Why we are not able to link image outside of the rails  
framework???

Thanks youv very much

Saiho

The mind is its own place, and in itself.  
Can make a Heaven of Hell, a Hell of Heaven.

> **[Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos](https://www.yahoo.com/)**
>
> Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

* * *

Do You Yahoo!?  
Tired of spam? Yahoo! Mail has the best spam protection around

> **[Yahoo Mail - Organized Email](https://mail.yahoo.com)**
>
> It's time to get stuff done with Yahoo Mail. Just add your Gmail, Outlook, AOL or Yahoo Mail to get going. We automatically organize all the things life throws at you, like receipts and attachments, so you can find what you need fast. Plus, we've got...

---

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [March 16, 2006, 5:44pm UTC](https://www.ruby-forum.com/t/image-doesnt-show-rhtml-path/55048/2 "2006-03-16T17:44:29Z")

</div>

Saiho ~

The user that runs the webserver does not have permission to access  
that file, it would be a huge security hole if it could. You need to  
have images in public/images.

~ Ben

On 3/16/06, Saiho Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Why we are not able to link image outside of the rails

–  
Ben R.  
[http://www.benr75.com](http://www.benr75.com)

---

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [March 16, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/image-doesnt-show-rhtml-path/55048/3 "2006-03-16T17:50:39Z")

</div>

If the security is not a problem(the folder contains  
only images) so can I simply change the the folder  
right?

— Ben R. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On 3/16/06, Saiho Y. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > /opt/rails/project1/, so inside “project1” we have
> > 
> > Saiho  
> > Tired of spam? Yahoo! Mail has the best spam  
> > –  
> > Ben R.  
> > [http://www.benr75.com](http://www.benr75.com)
> 
> * * *
> 
> Rails mailing list  
> removed\_email\_address@domain.invalid  
> [http://lists.rubyonrails.org/mailman/listinfo/rails](http://lists.rubyonrails.org/mailman/listinfo/rails)

The mind is its own place, and in itself.  
Can make a Heaven of Hell, a Hell of Heaven.

> **[Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos](https://www.yahoo.com)**
>
> Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

* * *

Do You Yahoo!?  
Tired of spam? Yahoo! Mail has the best spam protection around

> **[\[object](https://mail.yahoo.com/)**
>
> \[object

---

<div class="post-metadata">

**Author:** ![sayoyo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ba8739/32.png) [@sayoyo](https://www.ruby-forum.com/u/sayoyo)\
**Post date:** [March 17, 2006, 8:29am UTC](https://www.ruby-forum.com/t/image-doesnt-show-rhtml-path/55048/4 "2006-03-17T08:29:59Z")

</div>

If you’re running this under a webserver (apache or lighty), you can  
configure a directory  
in the file system to be available under a certain path for a given  
host. Look at the docs  
for your server to see how to do that.

But putting a filesystem path in an html img tag is never gonna work…  
and it shouldn’t.  
That would be a terrible security hole to just be able to enter any file  
path into an html  
tag.

b
