Forum: Ruby on Rails Problem with the image

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7f55417af9011c901a29abdde985cece?d=identicon&s=25 Guest (Guest)
on 2006-04-24 08:39
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.
D0cd6b10e01bacb976b3b815a9c660bc?d=identicon&s=25 Alex Wayne (Guest)
on 2006-04-24 10:45
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?
7f55417af9011c901a29abdde985cece?d=identicon&s=25 Guest (Guest)
on 2006-04-24 11:33
Alex Wayne 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 :
<img src="xyz.jpg" width="200" height="50">
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!
:(
Fd1769776698da69ffd5bdda094d8581?d=identicon&s=25 Jon Evans (Guest)
on 2006-04-24 12:02
(Received via mailing list)
Hi,

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

> My HTML code says :
> <img src="xyz.jpg" width="200" height="50">

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

<img src="/images/xyz.jpg" width="200" height="50">

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:

<img src="/xyz.jpg" width="200" height="50">

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
7f55417af9011c901a29abdde985cece?d=identicon&s=25 Guest (Guest)
on 2006-04-24 12:07
Jon Evans wrote:
> Hi,
>
> On 24 Apr 2006, at 10:33, Guest wrote:
>
>> My HTML code says :
>> <img src="xyz.jpg" width="200" height="50">
>
> What directory in your filesystem contains the image?  If the image
> is in $RAILS_ROOT/public/images, your img tag should be
>
> <img src="/images/xyz.jpg" width="200" height="50">
>
> 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:
>
> <img src="/xyz.jpg" width="200" height="50">
>
> 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.
:)
This topic is locked and can not be replied to.