Creating meaningful urls, (changing default)

Hi,

Urls in ruby are as defualt set to :controller/:action/:id

How can I change it to somthing like this
:controller/:action/:id/#random title#

#random title# may be a variable or taken from a field in the database

thanks
scott

scot wrote:

How can I change it to somthing like this
:controller/:action/:id/#random title#

The default answer would be don’t. Resist the urge. Your primary keys
aren’t combined keys, your Urls don’t need to be either.

But I know there are many reasons for wanting this. Here’s one take:

http://blog.hasmanythrough.com/articles/2006/07/07/more-on-naming-and-the-crud

If you can live with :controller/:action/:id-#random title# instead that
might be the easiest way to go.

I’m pretty sure there is an easy way to get exactly what you’re after
too, but I’ll let someone who understands routes better chime in with
the details.

Matt G.
http://mattgriffith.net

Matt G. wrote:

scot wrote:

How can I change it to somthing like this
:controller/:action/:id/#random title#

The default answer would be don’t. Resist the urge. Your primary keys
aren’t combined keys, your Urls don’t need to be either.

SEO is the main reason for wanting to change the defult url layout,
thanks for the link. Given me a couple more ideas for url layouts.

scot wrote:

How can I change it to somthing like this
:controller/:action/:id/#random title#

http://plasmasturm.org/log/358/

Eric

scot wrote:

nice link, exactly what I need to do, any suggestions on how to go about
doing this?

http://www.notsostupid.com/blog/2006/07/07/urls-on-rails/

Eric

Eric A. wrote:

scot wrote:

How can I change it to somthing like this
:controller/:action/:id/#random title#

Transparent opaque changeable permanent URIs // plasmasturm.org

Eric

nice link, exactly what I need to do, any suggestions on how to go about
doing this?

i m also looking for the same…

scot wrote:

Hi,

Urls in ruby are as defualt set to :controller/:action/:id

How can I change it to somthing like this
:controller/:action/:id/#random title#

#random title# may be a variable or taken from a field in the database

thanks
scott