# Couldn't find Photo with ID=index

**URL:** <https://www.ruby-forum.com/t/couldnt-find-photo-with-id-index/144595>\
**Category:** Rails\
**Created:** [July 31, 2008, 9:58am UTC](https://www.ruby-forum.com/t/couldnt-find-photo-with-id-index/144595 "2008-07-31T09:58:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mostafa\_badawi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f14d63/32.png) [@mostafa\_badawi](https://www.ruby-forum.com/u/mostafa_badawi)\
**Post date:** [July 31, 2008, 9:58am UTC](https://www.ruby-forum.com/t/couldnt-find-photo-with-id-index/144595/1 "2008-07-31T09:58:23Z")

</div>

Hi all,

I need help in this problem.

- i have a model class named Photo, a controller Photos.
- when typing the URL [http://localhost:3000/photos](http://localhost:3000/photos) Rails calls the  
default  
index method.
- but when typing [http://localhost:3000/photos/index](http://localhost:3000/photos/index) error saying  
“Couldn’t  
find Photo with ID=index” pops up, i cant even imagine why.
- my Rails version is 2.1.0

thanks in advance  
yours,  
Mostafa Badawi

---

<div class="post-metadata">

**Author:** ![mostafa\_badawi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/f14d63/32.png) [@mostafa\_badawi](https://www.ruby-forum.com/u/mostafa_badawi)\
**Post date:** [July 31, 2008, 11:26am UTC](https://www.ruby-forum.com/t/couldnt-find-photo-with-id-index/144595/2 "2008-07-31T11:26:47Z")

</div>

Sounds like a routing problem. Take a look in your config/routes.rb  
file and see what it says about ‘photos’ in there. You might need a  
line like  
map.resource :photos  
or something like that.

What’s happening is probably that Rails is trying to interpret /photos/  
index as a :controller/:id type of URL. Understood in this framework,  
the controller would be ‘photos’ and the id would be ‘index’.

-Mike
