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?



ruby 1.8.2
rails 1.0.0

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