Hi, 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 project. I can use this: map.resources :accounts do |account| account.resources :projects end 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 -- 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.
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. On 16 March 2010 01:51, petr.blaho <petr.blaho@gmail.com> wrote:> Hi, > > 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 > project. > > I can use this: > map.resources :accounts do |account| > account.resources :projects > end > 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 > > -- > 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<rubyonrails-core%2Bunsubscribe@googlegroups.com> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-core?hl=en. > >-- Ryan Bigg / Radar -- 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.
Hi Ryan, I didn''t know this. Sorry for bothering. I will post my question in rubyonrails-talk. Thank you for information. With regards Petr Blaho On 15 bře, 20:52, Ryan Bigg <radarliste...@gmail.com> wrote:> 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. > > On 16 March 2010 01:51, petr.blaho <petr.bl...@gmail.com> wrote: > > > > > > > Hi, > > > 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 > > project. > > > I can use this: > > map.resources :accounts do |account| > > account.resources :projects > > end > > 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 > > > -- > > 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<rubyonrails-core%2Bunsubscrib e@googlegroups.com> > > . > > For more options, visit this group at > >http://groups.google.com/group/rubyonrails-core?hl=en. > > -- > Ryan Bigg / Radar-- 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.