btw - I also tried
map.resources :users, :path_prefix => "/:username"
but that still leaves the url as:
/users/<username>/contacts
I'm trying to get rid of the '/users' in the front.
On Aug 10, 5:31 pm, lunaclaire <[email protected]> wrote:
> I have a set of nested resources as follows:
>
> map.resources :users
> map.resources :users, :has_many => :contacts
>
> this gives me a std route as follows to list a user's contacts in the
> ContactsController 'index' action:
>
> /users/<user id>/contacts
>
> A User has a 'username' and what I'd like to do is have the route/url
> look like:
>
> /<username>/contacts
>
> Does anyone know how to do this? I've tried using map.connect, but
> that doesnt seem to work.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---