skill-assessment-app/app/controllers/admin/dashboard_controller.rb

28 lines
529 B
Ruby
Raw Permalink Normal View History

2016-09-21 17:04:08 -05:00
# frozen_string_literal: true
module Admin
class DashboardController < AdminController
def show
authorize :dashboard
2016-09-22 16:29:19 -05:00
send "redirect_for_#{current_user.role}"
2016-09-21 17:04:08 -05:00
end
2016-09-22 16:29:19 -05:00
private
def redirect_for_admin
redirect_to admin_users_url
end
def redirect_for_manager
redirect_to admin_quizzes_url
end
def redirect_for_reviewer
redirect_to admin_results_url
end
def redirect_for_recruiter
redirect_to admin_candidates_url
end
2016-09-21 17:04:08 -05:00
end
end