How can I make url with only id parts?


I am trying to solve this problem:

I have these resources:

map.resource :account
map.resources :projects

so my urls to projects looks like this: /projects/:id

But client has changed his mind and now he wants urls like
this: /:account_id/:project_slug

This project_slug (using friendly_url gem) is unique in scope of
account, so I need booth account_id and project_slug to identify

I can use this:
map.resources :accounts do |account|
  account.resources :projects
to make urls like this: /accounts/:account_id/projects/:project_id

but this is not what I want.

Can someone, please, show me the right way to do this?

With regards
Petr Blaho

Hi Petr, the best list to ask questions like this is the rubyonrails-talk list. The core list is generally reserved for Ruby on Rails core issues.

Hi Ryan,

I didn't know this. Sorry for bothering. I will post my question in
Thank you for information.

With regards
Petr Blaho