Commit bcea7ba331e26c037dda9782f069bfb38f5bb602

Authored by Dmitriy Zaporozhets
2 parents 0d13abb1 3dc0bce9

Merge branch 'namespace-route' into 'master'

Namespace route

Fixes #1312
app/controllers/namespaces_controller.rb 0 → 100644
... ... @@ -0,0 +1,18 @@
  1 +class NamespacesController < ApplicationController
  2 + skip_before_filter :authenticate_user!
  3 +
  4 + def show
  5 + namespace = Namespace.find_by(path: params[:id])
  6 +
  7 + unless namespace
  8 + return render_404
  9 + end
  10 +
  11 + if namespace.type == "Group"
  12 + redirect_to group_path(namespace)
  13 + else
  14 + redirect_to user_path(namespace.owner)
  15 + end
  16 + end
  17 +end
  18 +
... ...
config/routes.rb
... ... @@ -315,7 +315,7 @@ Gitlab::Application.routes.draw do
315 315 end
316 316 end
317 317  
318   - get ':id' => "groups#show", constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
  318 + get ':id' => "namespaces#show", constraints: {id: /(?:[^.]|\.(?!atom$))+/, format: /atom/}
319 319  
320 320 root to: "dashboard#show"
321 321 end
... ...