Convert controllers/dashboard_controller to JS