dawarich/app/controllers/stats_controller.rb
2024-03-24 19:25:33 +01:00

13 lines
331 B
Ruby

class StatsController < ApplicationController
before_action :authenticate_user!
def index
@stats = current_user.stats.group_by(&:year).sort_by { _1 }.reverse
end
def update
StatCreatingJob.perform_later(current_user.id)
redirect_to stats_path, notice: 'Stats are being updated', status: :see_other
end
end