Instead of blah/16 can i have the title there?

Hey guys

You know how by default the scaffold show view takes you to for ex-
www.blah.com/blahs/16?

How would i replace that 16 with something else?.. most preferably
the title field or something

What do i need to change in the routes? Thanks

On Sun, Apr 4, 2010 at 4:08 PM, David Z. [email protected]
wrote:

Hey guys

You know how by default the scaffold show view takes you to for ex-
www.blah.com/blahs/16?

How would i replace that 16 with something else?.. most preferably
the title field or something

David, please take a look at the to_param method which you can redefine
to
display something other than the id field.

Good luck,

-Conrad

On Sun, Apr 4, 2010 at 4:27 PM, Conrad T. [email protected]
wrote:

David, here’s an excellent blog post by Obie F. which goes into
further
detail about using to to_param method:

http://www.jroller.com/obie/entry/seo_optimization_of_urls_in

Good luck,

-Conrad

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs