# How to make routes that mimi Flickr's URLs

**URL:** <https://www.ruby-forum.com/t/how-to-make-routes-that-mimi-flickrs-urls/184670>\
**Category:** Rails\
**Created:** [March 6, 2010, 7:56am UTC](https://www.ruby-forum.com/t/how-to-make-routes-that-mimi-flickrs-urls/184670 "2010-03-06T07:56:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![interactivenyc](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/85f322/32.png) [@interactivenyc](https://www.ruby-forum.com/u/interactivenyc)\
**Post date:** [March 6, 2010, 7:56am UTC](https://www.ruby-forum.com/t/how-to-make-routes-that-mimi-flickrs-urls/184670/1 "2010-03-06T07:56:38Z")

</div>

I have two resources, :users and :photos. Users is based on AuthLogic.  
Photos has a type set to private or public. I would like configure my  
routes to mimic the Flickr URL structure.

The routes I want are:

[foo.com/photos](http://foo.com/photos) = controller =\> photos, action =\> index,

```
This route will display the last n photos across all Users

```

[foo.com/steve/photos](http://foo.com/steve/photos) where steve is a Users login = ???

```
Not sure how to do with this route. It looks like a nested route,
but I don't want "foo.com/users/steve/photos"
Its also not the user id, but the user login.

If the user is logged in, this route will display all the user's

```

photos.  
If the user is not logged in, it will display their public photos.

[foo.com/steve/photos/id](http://foo.com/steve/photos/id) where id is Photo id = ???

```
Again, don't know what route should be. Again, looks like a nested

```

route  
above, but without the “users” in the path.

```
If the user is logged in, it will display the specified photo.
If the user is not logged in, it will display the photo if it is

```

public.

Any suggestions would be appreciated.

- Steve W.
