FIX 完善路由
This commit is contained in:
parent
6bd8095258
commit
5f36b517b4
|
@ -82,21 +82,46 @@ Rails.application.routes.draw do
|
|||
end
|
||||
|
||||
# Project Area START
|
||||
resources :namespaces, path: '/', constraints: { id: /[a-zA-Z.0-9_\-]+/ }, only: [] do
|
||||
resources(:projects, constraints: { id: /[a-zA-Z.0-9_\-]+(?<!\.atom)/ }, except:
|
||||
[:new, :create, :index], path: "/") do
|
||||
member do
|
||||
get :activity
|
||||
get :branches
|
||||
get :simple
|
||||
get :branches
|
||||
post :watch
|
||||
get :watch_users, :path => :watchers
|
||||
get :praise_users, :path => :stargazers
|
||||
get :fork_users, :path => :members
|
||||
scope "/:owner/:repo" do
|
||||
scope do
|
||||
get(
|
||||
'/activity',
|
||||
to: 'project_trends#index',
|
||||
as: :project_activity
|
||||
)
|
||||
|
||||
get(
|
||||
'/branches',
|
||||
to: 'projects#branches',
|
||||
as: :project_branches
|
||||
)
|
||||
|
||||
get(
|
||||
'/simple',
|
||||
to: 'projects#simple',
|
||||
as: :project_simple
|
||||
)
|
||||
|
||||
get(
|
||||
'/watchers',
|
||||
to: 'projects#watch_users',
|
||||
as: :project_watchers
|
||||
)
|
||||
|
||||
get(
|
||||
'/stargazers',
|
||||
to: 'projects#praise_users',
|
||||
as: :project_stargazers
|
||||
)
|
||||
|
||||
get(
|
||||
'/members',
|
||||
to: 'projects#fork_users',
|
||||
as: :project_members
|
||||
)
|
||||
end
|
||||
|
||||
resource :repository, only: [:show, :create, :edit] do
|
||||
resource :repositories, path: '/', only: [:show, :create, :edit] do
|
||||
member do
|
||||
get 'archive'
|
||||
get 'top_counts'
|
||||
|
@ -212,7 +237,6 @@ Rails.application.routes.draw do
|
|||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
# Project Area END
|
||||
|
||||
resources :accounts do
|
||||
|
|
Loading…
Reference in New Issue