From a0789cbd2253d285b74ac1fdce429e8e0af4fbfa Mon Sep 17 00:00:00 2001 From: Jasder <2053003901@@qq.com> Date: Wed, 12 Aug 2020 18:22:03 +0800 Subject: [PATCH] FIX project routes bug --- config/routes.rb | 38 +++++++++----------------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/config/routes.rb b/config/routes.rb index fb7d8be63..a46d8d880 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -235,36 +235,16 @@ Rails.application.routes.draw do to: 'project_trends#index', as: :project_activity ) + end - 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 - ) + resource :projects, path: '/' do + member do + get :branches + get :simple + get :watchers, to: 'projects#watch_users' + get :stargazers, to: 'projects#praise_users' + get :members, to: 'projects#fork_users' + end end resource :repositories, path: '/', only: [:show, :create, :edit] do