Routing nested resources in Rails 3

后端 未结 5 619
無奈伤痛
無奈伤痛 2020-12-07 20:51

I have a pretty common case for nested routes, I feel like, that looks something like this (in some sort of pseudonotation):

\'/:username/photos\' => Show         


        
5条回答
  •  难免孤独
    2020-12-07 21:20

    Example::Application.routes.draw do
      resources :accounts, :path => '' do
        resources :projects, :path => '', :except => [:index]
      end
    end
    

    Got the example from: http://jasoncodes.com/posts/rails-3-nested-resource-slugs

    Just applied that in my current project.

提交回复
热议问题