To_param() / url generation Question

I’m trying to implement the to_param method to allow url generation to
be in the format of /:category_name/:article_permalink (as discussed on
page 299 of Agile Web D. With Rails).

I expect that I need to override/implement the to_param method and have
it return the category_name for the category model and the
article_permalink for my article model, but I haven’t had any luck in
doing this. I’m sure it is a problem with the syntax…

Can anyone help me out with an example?

And as long as routes.rb has a matching map.connect the links generated
by rails should match, correct?

Thanks,

Chris

using:
ruby 1.8.2
rails 1.0.0