Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-09-02 03:57:56 +0300
committerStan Hu <stanhu@gmail.com>2015-09-02 09:29:27 +0300
commitfbb891c8f3818b9aa17fadbb984ff7d33053c819 (patch)
tree4b4f76be3d2d7748973d200783da5ed6a457dc1b /config
parent308c6428aef2a46b0370a24d85a97b0e133283a8 (diff)
Fix broken Wiki Page History
Closes #2104 Closes #1751 Closes #1592 Closes https://github.com/gitlabhq/gitlabhq/issues/9399
Diffstat (limited to 'config')
-rw-r--r--config/routes.rb22
1 files changed, 13 insertions, 9 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 920ece518ea..15da21f04e5 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -406,16 +406,20 @@ Gitlab::Application.routes.draw do
end
end
- resources :wikis, only: [:show, :edit, :destroy, :create], constraints: { id: /[a-zA-Z.0-9_\-\/]+/ } do
- collection do
- get :pages
- put ':id' => 'wikis#update'
- get :git_access
- end
+ WIKI_SLUG_ID = { id: /[a-zA-Z.0-9_\-\/]+/ } unless defined? WIKI_SLUG_ID
- member do
- get 'history'
- end
+ scope do
+ # Order matters to give priority to these matches
+ get '/wikis/git_access', to: 'wikis#git_access'
+ get '/wikis/pages', to: 'wikis#pages', as: 'wiki_pages'
+ post '/wikis', to: 'wikis#create'
+
+ get '/wikis/*id/history', to: 'wikis#history', as: 'wiki_history', constraints: WIKI_SLUG_ID
+ get '/wikis/*id/edit', to: 'wikis#edit', as: 'wiki_edit', constraints: WIKI_SLUG_ID
+
+ get '/wikis/*id', to: 'wikis#show', as: 'wiki', constraints: WIKI_SLUG_ID
+ delete '/wikis/*id', to: 'wikis#destroy', constraints: WIKI_SLUG_ID
+ put '/wikis/*id', to: 'wikis#update', constraints: WIKI_SLUG_ID
end
resource :repository, only: [:show, :create] do