我使用Rails 3.2Rails的路由像github上
我想有路由非常酷似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
看起来很有趣。我得看看那个railscast。我想知道它是如何存储在内部的,如果使用不同的数据库很重要。 – Ron 2012-07-17 18:41:31
这很酷。不完全是我想要的,但会有所帮助。我更加关注的是github的工作原理。所以你不需要像/ users/Jonovono这样的url,而只需要/ Jonovono的作品。 – Jonovono 2012-07-17 19:15:26
http://stackoverflow.com/questions/2968722/github-url-style – 2012-07-17 19:18:20