On Sun, Apr 4, 2010 at 4:27 PM, Conrad Taylor <[email protected]> wrote:

> On Sun, Apr 4, 2010 at 4:08 PM, David Zhu <[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
>
>
>> What do i need to change in the routes? Thanks
>>
>>

David, here's an excellent blog post by Obie Fernandez 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


> --
>> 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 [email protected].
>> To unsubscribe from this group, send email to
>> [email protected]<rubyonrails-talk%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/rubyonrails-talk?hl=en.
>>
>>
>

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to