summaryrefslogtreecommitdiff
path: root/config/routes.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-09-01 17:57:56 -0700
committerStan Hu <stanhu@gmail.com>2015-09-01 23:29:27 -0700
commitfbb891c8f3818b9aa17fadbb984ff7d33053c819 (patch)
tree4b4f76be3d2d7748973d200783da5ed6a457dc1b /config/routes.rb
parent308c6428aef2a46b0370a24d85a97b0e133283a8 (diff)
downloadgitlab-ce-fbb891c8f3818b9aa17fadbb984ff7d33053c819.tar.gz
Fix broken Wiki Page History
Closes #2104 Closes #1751 Closes #1592 Closes https://github.com/gitlabhq/gitlabhq/issues/9399
Diffstat (limited to 'config/routes.rb')
-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