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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
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 -------- http://blog.ravet.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 20 May 2007, at 13:52, Alain Ravet wrote:> 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?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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---