On Jul 15, 2007, at 7:45 AM, gobigdave wrote:> I have many REST routes in my application, including
>
> map.resources :users
>
> This works well, and my url ends up /users/2 for a specific user.
> However, how do I use resources when I want my specific user url
> ( user_url(2) ) to be:
>
> /users/2-john-smith
>
> Do I need to create all the routes manually? I didn''t see an
option
> in map.resources that would let me do that.
This list is for development of Rails itself, not for how to use
Rails. Try the rubyonrails-talk list for support.
That said, you want to define a to_param method for your model that
outputs the custom format id. I''ve done that myself and it works
fine with the standard route helper methods.
--
Josh Susser
http://blog.hasmanythrough.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Core" group.
To post to this group, send email to rubyonrails-core@googlegroups.com
To unsubscribe from this group, send email to
rubyonrails-core-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-core?hl=en
-~----------~----~----~----~------~----~------~--~---