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
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/root_controller.rb')
-rw-r--r--app/controllers/root_controller.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/app/controllers/root_controller.rb b/app/controllers/root_controller.rb
new file mode 100644
index 00000000000..7606d2d0fbe
--- /dev/null
+++ b/app/controllers/root_controller.rb
@@ -0,0 +1,18 @@
+# RootController
+#
+# This controller exists solely to handle requests to `root_url`. When a user is
+# logged in and has customized their `dashboard` setting, they will be
+# redirected to their preferred location.
+#
+# For users who haven't customized the setting, we simply delegate to
+# `DashboardController#show`, which is the default.
+class RootController < DashboardController
+ def show
+ case current_user.try(:dashboard)
+ when 'stars'
+ redirect_to starred_dashboard_projects_path
+ else
+ super
+ end
+ end
+end