urls

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

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

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

   > 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 Ravet

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