gitlab-org--gitlab-foss/app/controllers/namespaces_controller.rb
Dmitriy Zaporozhets 3dc0bce947
Add users to /:id route
So now when you type site/:username it redirects you to users page.
And if you type site/:groupname it redirects you to group page

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
2014-06-07 15:06:55 +03:00

18 lines
358 B
Ruby

class NamespacesController < ApplicationController
skip_before_filter :authenticate_user!
def show
namespace = Namespace.find_by(path: params[:id])
unless namespace
return render_404
end
if namespace.type == "Group"
redirect_to group_path(namespace)
else
redirect_to user_path(namespace.owner)
end
end
end