Rename @budget to @current budget at budget index
Clear instance variable names help understand what's going around when you're deep 2 or 3 partials. In this case @budget is only used to carry around the current_budget so @current_budget is more descriptive. Using `current_budget` directly around would be an alternative, but maybe not as maintainable in case we want to change which budget is being shown (for example the drafting one if you're admin).
This commit is contained in:
@@ -15,7 +15,7 @@ class BudgetsController < ApplicationController
|
||||
|
||||
def index
|
||||
@finished_budgets = @budgets.finished.order(created_at: :desc)
|
||||
@budget = current_budget
|
||||
@current_budget = current_budget
|
||||
@budgets_coordinates = current_budget_map_locations
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user