Files
nairobi/app/controllers/budgets/ballots_controller.rb
2016-09-10 16:22:41 +02:00

18 lines
389 B
Ruby

module Budgets
class BallotsController < ApplicationController
before_action :authenticate_user!
load_and_authorize_resource :budget
before_action :load_ballot
def show
render template: "budgets/ballot/show"
end
private
def load_ballot
@ballot = Budget::Ballot.where(user: current_user, budget: @budget).first_or_create
end
end
end