Forum: Ruby on Rails to_param() / url generation Question

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Chris N. (Guest)
on 2006-02-01 22:10
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
This topic is locked and can not be replied to.