class Admin::ScoresController < ApplicationController def export csv_data = TartifletteScoreExportService.generate_csv send_data csv_data, filename: "scores-#{Date.today}.csv" end private def require_admin unless logged_in? && current_user.admin? redirect_to root_path, alert: "Access denied." end end end