Review my votes page

This commit is contained in:
rgarcia
2016-09-09 18:49:37 +02:00
parent 85d70a2cc2
commit 22373c3ddd
11 changed files with 130 additions and 135 deletions

View File

@@ -16,7 +16,7 @@ module Budgets
load_investment
load_heading
if @line.save
if @ballot.add_investment(@investment)
#@ballot.set_geozone(@geozone)
#@current_user.update(representative_id: nil)
if request.get?

View File

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