Files
grecia/app/controllers/budgets/stats_controller.rb
2020-07-28 13:19:48 +02:00

19 lines
395 B
Ruby

module Budgets
class StatsController < ApplicationController
before_action :load_budget
authorize_resource :budget
def show
authorize! :read_stats, @budget
@stats = Budget::Stats.new(@budget)
@headings = @budget.headings.sort_by_name
end
private
def load_budget
@budget = Budget.find_by_slug_or_id! params[:budget_id]
end
end
end