我正在使用 Rails 3.2
我希望路由与 github 非常相似,所以:
root/(username)
root/(username)/(projectname)
root/(username)/(projectname)/issus
等等
我正在尝试这样的事情:
resources :publishers do
resources :magazines do
resources :photos
end
end
但这给出了这样的路线:
/publishers/1/magazines/2/photos/3
我正在查看的一个项目执行以下操作,这似乎有效但似乎不适合我。
resources :projects, :constraints => { :id => /[^\/]+/ }, :except => [:new, :create, :index], :path => "/" do
member do
get "team"
get "wall"
get "graph"
get "files"
end
resources :wikis, :only => [:show, :edit, :destroy, :create] do
member do
get "history"
end
end