# Urls

**URL:** <https://www.ruby-forum.com/t/urls/104605>\
**Category:** Rails\
**Created:** [May 20, 2007, 1:39pm UTC](https://www.ruby-forum.com/t/urls/104605 "2007-05-20T13:39:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tarscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Post date:** [May 20, 2007, 1:39pm UTC](https://www.ruby-forum.com/t/urls/104605/1 "2007-05-20T13:39:37Z")

</div>

Hi all,

I want to make a site for restaurants. Give them blogs, forum and  
albums.

Since I provide www.restaurantsite.be I would like to put the name of  
the restaurant between eg. www.restaurantsite.be/nameofrest/ . Where  
nameofrest changes according to the name of the restaurant. This  
results in urls like: www.restaurantsite.be/nameofrest/post/create/1,  
www.restaurantsite.be/nameofrest/album/

I have a hard time figuring out how to put the ‘nameofrest’ in the  
url. I probably have to use routes?

Best regards  
Stijn

---

<div class="post-metadata">

**Author:** ![Tarscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Post date:** [May 20, 2007, 11:38pm UTC](https://www.ruby-forum.com/t/urls/104605/2 "2007-05-20T23:38:25Z")

</div>

On 20 May 2007, at 13:52, Alain R. wrote:

> If you don’t, there is a Belgian mailing list where you can find some
> 
> - have to separate homonyms =\> use the zip code, before the name?  
> A solution like acts\_as\_friendly\_params would also be a good  
> solution, if you don’t mind having the ID of the record in front of  
> the cleaned up name. It’s easy to install and even easier to use,  
> especially if you’re as new to Rails as you seem to be, Stijn (as you  
> can see, there are quite a few Belgian Rails users around :-))

Best regards

Peter De Berdt

---

<div class="post-metadata">

**Author:** ![Tarscher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/8491ac/32.png) [@Tarscher](https://www.ruby-forum.com/u/Tarscher)\
**Post date:** [May 20, 2007, 1:53pm UTC](https://www.ruby-forum.com/t/urls/104605/3 "2007-05-20T13:53:39Z")

</div>

Stijn,

> www.restaurantsite.be/nameofrest/album/  
> I have a hard time figuring out how to put the ‘nameofrest’ in the  
> url. I probably have to use routes?

Yes, routes are the way to do that in Rails.  
If you plan to do it yourself, you should read the fine book :  
[http://www.pragmaticprogrammer.com/titles/rails/index.html](http://www.pragmaticprogrammer.com/titles/rails/index.html)

If you don’t, there is a Belgian mailing list where you can find some  
help(manpower, not technical questions) :  
[http://groups.google.com/group/rubyonrails-belgium](http://groups.google.com/group/rubyonrails-belgium)

> results in urls like:  
> www.restaurantsite.be/nameofrest/post/create/1,

A few obvious problems: you will

- end up with long and ugly urls
- have to "uniformize special characters (“l’Orée du Bois”, “'t  
Cafeetje”, etc…)
- have to separate homonyms =\> use the zip code, before the name?

## Alain R.

[http://blog.ravet.com](http://blog.ravet.com)
