Files
gitlabhq/app/controllers/root_controller.rb
T
Douwe Maan 5d785457db Clean up overlap between dashboard and explore.
- Split up SnippetsController into separate dashboard and explore sections.
- Use consistent page titles, header titles and sidebars between dashboard and explore sections when signed in or not.
2015-09-08 14:49:20 +01:00

30 lines
715 B
Ruby

# 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 < Dashboard::ProjectsController
before_action :redirect_to_custom_dashboard, only: [:show]
def index
super
end
private
def redirect_to_custom_dashboard
return unless current_user
case current_user.dashboard
when 'stars'
flash.keep
redirect_to starred_dashboard_projects_path
else
return
end
end
end