Fix "go back" link in ballot page

Since the `@ballot_referer` variable was only set in the lines
controller, it didn't work when we accessed the ballot page without
adding a line.

Note it still doesn't work if we access the ballot page directly by
entering the URL in the browser's address bar.
This commit is contained in:
Javi Martín
2021-03-19 13:39:58 +01:00
parent 135e154fe3
commit 2552330fe0
3 changed files with 34 additions and 22 deletions

View File

@@ -7,7 +7,6 @@ module Budgets
before_action :load_tag_cloud
before_action :load_categories
before_action :load_investments
before_action :load_ballot_referer
authorize_resource :budget
authorize_resource :ballot
@@ -67,10 +66,6 @@ module Budgets
@categories = Tag.category.order(:name)
end
def load_ballot_referer
@ballot_referer = session[:ballot_referer]
end
def load_map
@investments ||= []
@investments_map_coordinates = MapLocation.where(investment: @investments).map(&:json_data)