gitlab-org--gitlab-foss/config/routes/wiki.rb
Dmitriy Zaporozhets 6683fdcfb0
Add nested groups support to the routing
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2016-11-23 14:08:36 +02:00

19 lines
512 B
Ruby

WIKI_SLUG_ID = { id: /\S+/ } unless defined? WIKI_SLUG_ID
scope(controller: :wikis) do
scope(path: 'wikis', as: :wikis) do
get :git_access
get :pages
get '/', to: redirect('/%{namespace_id}/%{project_id}/wikis/home')
post '/', to: 'wikis#create'
end
scope(path: 'wikis/*id', as: :wiki, constraints: WIKI_SLUG_ID, format: false) do
get :edit
get :history
post :preview_markdown
get '/', action: :show
put '/', action: :update
delete '/', action: :destroy
end
end