# Problems with public/images

**URL:** <https://www.ruby-forum.com/t/problems-with-public-images/178645>\
**Category:** Rails\
**Created:** [November 8, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/problems-with-public-images/178645 "2009-11-08T21:57:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![closedbook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@closedbook](https://www.ruby-forum.com/u/closedbook)\
**Post date:** [November 8, 2009, 9:57pm UTC](https://www.ruby-forum.com/t/problems-with-public-images/178645/1 "2009-11-08T21:57:26Z")

</div>

Hi all,

I’m having trouble getting images to show up on the browser. I added an  
image to the public/images directory in Textmate, however all I get is  
the image alt information when I refresh my browser. This is the image  
tag code copied and pasted from my layout file:

\<%= image\_tag(“kanagawa.jpg”) %\>

This is the error I get in the server log:

Processing ApplicationController#index (for XXX.X.X.X at 2009-11-08  
15:50:00) [GET]

ActionController::RoutingError (No route matches “/images/kanagawa.jpg”  
with {:method=\>:get}):

Rendering rescues/layout (not\_found)

In addition (oddly), whenever I close Textmate out and reopen it, the  
image file I inserted in public/images is gone. I couldn’t find anything  
helpful from google when I entered the information.

I appreciate any help.

---

<div class="post-metadata">

**Author:** ![closedbook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@closedbook](https://www.ruby-forum.com/u/closedbook)\
**Post date:** [November 8, 2009, 10:29pm UTC](https://www.ruby-forum.com/t/problems-with-public-images/178645/2 "2009-11-08T22:29:19Z")

</div>

Chris To wrote:

> Hi all,
> 
> I’m having trouble getting images to show up on the browser. I added an  
> image to the public/images directory in Textmate, however all I get is  
> the image alt information when I refresh my browser.  
> […]
> 
> In addition (oddly), whenever I close Textmate out and reopen it, the  
> image file I inserted in public/images is gone. I couldn’t find anything  
> helpful from google when I entered the information.
> 
> I appreciate any help.

Sounds like the image file isn’t actually getting put where you think it  
is. Why not use the Finder or the command line to put the file in the  
right place?

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![closedbook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@closedbook](https://www.ruby-forum.com/u/closedbook)\
**Post date:** [November 9, 2009, 7:07am UTC](https://www.ruby-forum.com/t/problems-with-public-images/178645/3 "2009-11-09T07:07:29Z")

</div>

Hi Chris

> \<%= image\_tag(“kanagawa.jpg”) %\>

What happens if you try with

\<%= image\_tag("/images/kanagawa.jpg") %\>

Sijo

---

<div class="post-metadata">

**Author:** ![closedbook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@closedbook](https://www.ruby-forum.com/u/closedbook)\
**Post date:** [November 9, 2009, 12:22pm UTC](https://www.ruby-forum.com/t/problems-with-public-images/178645/4 "2009-11-09T12:22:32Z")

</div>

Sijo k g wrote:

> Hi Chris
> 
> > \<%= image\_tag(“kanagawa.jpg”) %\>
> 
> What happens if you try with
> 
> \<%= image\_tag(“/images/kanagawa.jpg”) %\>

That should not be necessary.

> Sijo

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![closedbook](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/82dd89/32.png) [@closedbook](https://www.ruby-forum.com/u/closedbook)\
**Post date:** [November 9, 2009, 2:22pm UTC](https://www.ruby-forum.com/t/problems-with-public-images/178645/5 "2009-11-09T14:22:48Z")

</div>

Marnen Laibow-Koser wrote:

> Chris To wrote:
> 
> > Hi all,
> > 
> > I’m having trouble getting images to show up on the browser. I added an  
> > image to the public/images directory in Textmate, however all I get is  
> > the image alt information when I refresh my browser.  
> > […]
> > 
> > In addition (oddly), whenever I close Textmate out and reopen it, the  
> > image file I inserted in public/images is gone. I couldn’t find anything  
> > helpful from google when I entered the information.
> > 
> > I appreciate any help.
> 
> Sounds like the image file isn’t actually getting put where you think it  
> is. Why not use the Finder or the command line to put the file in the  
> right place?
> 
> ## Best,
> 
> Marnen Laibow-Koser  
> [http://www.marnen.org](http://www.marnen.org)  
> removed\_email\_address@domain.invalid

Thanks for the replies everyone,

Adding the file directly within the finder worked (Marnen’s suggestion).  
I tried doing

\<%= image\_tag(“/images/kanagawa.jpg”) %\>

but that didn’t work either. Adding image files that aren’t really  
associated with your application must be a curiosity within Textmate  
itself.

Thanks everyone for your help!
