Move current budget's geolocated investments code to helper function
This commit is contained in:
@@ -16,8 +16,7 @@ class BudgetsController < ApplicationController
|
||||
def index
|
||||
@budgets = @budgets.order(:created_at)
|
||||
@budget = current_budget
|
||||
budgets_map_locations = current_budget.investments.map{ |investment| investment.map_location }.compact
|
||||
@budgets_coordinates = budgets_map_locations.map{ |ml| {lat: ml.latitude, long: ml.longitude, investment_title: ml.investment.title , investment_id: ml.investment.id, budget_id: ml.investment.budget.id}}
|
||||
@budgets_coordinates = current_budget_map_locations
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user