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