# Adding image using html into a view file

**URL:** <https://www.ruby-forum.com/t/adding-image-using-html-into-a-view-file/187751>\
**Category:** Rails\
**Created:** [April 28, 2010, 8:57pm UTC](https://www.ruby-forum.com/t/adding-image-using-html-into-a-view-file/187751 "2010-04-28T20:57:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![woodsy0130](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/43a26b/32.png) [@woodsy0130](https://www.ruby-forum.com/u/woodsy0130)\
**Post date:** [April 28, 2010, 8:57pm UTC](https://www.ruby-forum.com/t/adding-image-using-html-into-a-view-file/187751/1 "2010-04-28T20:57:22Z")

</div>

Hello,

I have built a simple application using scaffolding and i have added a  
background image to my index pages of each model. This is using CSS  
and i have the background image in the image folder within the rails  
application.

However, i am unable to add a single image to an individual ‘view’  
page. I cant do this in css because i only want it on one page. When i  
add an image to a single view page using the following code,:

![logo]()

i check my browser and it comes up with a small box with a red cross  
in it saying ‘logo’. But not the image.

Can someone please explain what i can do in simple terms since i am a  
beginner at this sort of stuff.

Thanks,

Dale

---

<div class="post-metadata">

**Author:** ![woodsy0130](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/43a26b/32.png) [@woodsy0130](https://www.ruby-forum.com/u/woodsy0130)\
**Post date:** [April 28, 2010, 11:04pm UTC](https://www.ruby-forum.com/t/adding-image-using-html-into-a-view-file/187751/2 "2010-04-28T23:04:59Z")

</div>

On Apr 28, 2010, at 11:55 AM, woodsy0130 wrote:

> ![logo]()
> 
> i check my browser and it comes up with a small box with a red cross  
> in it saying ‘logo’. But not the image.
> 
> Can someone please explain what i can do in simple terms since i am a  
> beginner at this sort of stuff.

Try…

\<%= image\_tag ‘logo.gif’, :alt =\> 'logo %\>
