I am using Rails 3.2
I want to have routing just like github, so:
root/(username)
root/(username)/(projectname)
root/(username)/(projectname)/issus
and etc.
I am trying something like this:
resources :publishers do
resources :magazines do
resources :photos
end
end
But it gives such routes:
/publishers/1/magazines/2/photos/3
The project I'm looking at does the following, which seems to work, but doesn't seem to be for me.
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
source
share