summaryrefslogtreecommitdiff
path: root/app/controllers/admin/scores_controller.rb
blob: b4755e9117d0fb7c25dfcca3c5018f0ccff3c145 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
Copyright 2019--2025 Marius PETER