# Problem with the image

**URL:** <https://www.ruby-forum.com/t/problem-with-the-image/58626>\
**Category:** Rails\
**Created:** [April 24, 2006, 8:39am UTC](https://www.ruby-forum.com/t/problem-with-the-image/58626 "2006-04-24T08:39:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [April 24, 2006, 8:39am UTC](https://www.ruby-forum.com/t/problem-with-the-image/58626/1 "2006-04-24T08:39:46Z")

</div>

Hi there,  
A little problem has come up in my application.  
I want a logo to be displayed right at the top of my main page, and it  
is not working.  
Instead, it gives me an image thumbnail which shows that the image is at  
the right place but not displayed.  
If somebody could help.  
Thanks.

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [April 24, 2006, 10:45am UTC](https://www.ruby-forum.com/t/problem-with-the-image/58626/2 "2006-04-24T10:45:20Z")

</div>

Guest wrote:

> Hi there,  
> A little problem has come up in my application.  
> I want a logo to be displayed right at the top of my main page, and it  
> is not working.  
> Instead, it gives me an image thumbnail which shows that the image is at  
> the right place but not displayed.  
> If somebody could help.  
> Thanks.

When asking questions you please give context and a more details. In  
it’s current form your question is not really answerable.

What is your code that includes the image, and are you using the  
image\_tag helper? What html is generated that doesn’t work?

Please clarify what this means: “Instead, it gives me an image thumbnail  
which shows that the image is at the right place but not displayed.”

Is it a broken image icon?

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [April 24, 2006, 12:02pm UTC](https://www.ruby-forum.com/t/problem-with-the-image/58626/3 "2006-04-24T12:02:27Z")

</div>

Hi,

On 24 Apr 2006, at 10:33, Guest wrote:

> My HTML code says :  
> ![]()

What directory in your filesystem contains the image? If the image  
is in $RAILS\_ROOT/public/images, your img tag should be

![](https://www.ruby-forum.com/images/xyz.jpg)

Even if you’ve put your image in $RAILS\_ROOT/public, you’d still need  
to sling a “/” in there, to make it look like this:

![](https://www.ruby-forum.com/xyz.jpg)

This is because if you were browsing to /controller/application/  
action, your browser would request the image as /controller/  
application/xyz.jpg, which wouldn’t work.

Also you could try image\_tag, as suggested by Alex. In this case it  
would be:  
\<%= image\_tag(“xyz.jpg”, :size =\> “200x50”) %\>

Jon

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [April 24, 2006, 11:33am UTC](https://www.ruby-forum.com/t/problem-with-the-image/58626/4 "2006-04-24T11:33:46Z")

</div>

Alex W. wrote:

> Guest wrote:
> 
> > Hi there,  
> > A little problem has come up in my application.  
> > I want a logo to be displayed right at the top of my main page, and it  
> > is not working.  
> > Instead, it gives me an image thumbnail which shows that the image is at  
> > the right place but not displayed.  
> > If somebody could help.  
> > Thanks.
> 
> When asking questions you please give context and a more details. In  
> it’s current form your question is not really answerable.
> 
> What is your code that includes the image, and are you using the  
> image\_tag helper? What html is generated that doesn’t work?
> 
> Please clarify what this means: “Instead, it gives me an image thumbnail  
> which shows that the image is at the right place but not displayed.”
> 
> Is it a broken image icon?

Hie Alex,  
Thanks for your reply and at the same time I am sorry for not making it  
clear.  
My HTML code says :  
 ![]()  
And instead of displaying the image it gives me an icon which appears  
just before the image is uploaded…  
I am sorry but I don’t know what is it called!  
☹

---

<div class="post-metadata">

**Author:** ![guest](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/8dc957/32.png) [@guest](https://www.ruby-forum.com/u/guest)\
**Post date:** [April 24, 2006, 12:07pm UTC](https://www.ruby-forum.com/t/problem-with-the-image/58626/5 "2006-04-24T12:07:58Z")

</div>

Jon Evans wrote:

> Hi,
> 
> On 24 Apr 2006, at 10:33, Guest wrote:
> 
> > My HTML code says :  
> > ![]()
> 
> What directory in your filesystem contains the image? If the image  
> is in $RAILS\_ROOT/public/images, your img tag should be
> 
> ![](https://www.ruby-forum.com/images/xyz.jpg)
> 
> Even if you’ve put your image in $RAILS\_ROOT/public, you’d still need  
> to sling a “/” in there, to make it look like this:
> 
> ![](https://www.ruby-forum.com/xyz.jpg)
> 
> This is because if you were browsing to /controller/application/  
> action, your browser would request the image as /controller/  
> application/xyz.jpg, which wouldn’t work.
> 
> Also you could try image\_tag, as suggested by Alex. In this case it  
> would be:  
> \<%= image\_tag(“xyz.jpg”, :size =\> “200x50”) %\>
> 
> Jon

Hey guys!!!  
You are too good.  
It worked…  
The image\_tag worked.  
Thanks a ton.  
🙂
