Load budgets using slugs
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
class Management::Budgets::InvestmentsController < Management::BaseController
|
||||
before_action :load_budget
|
||||
|
||||
load_resource :budget
|
||||
load_resource :investment, through: :budget, class: "Budget::Investment"
|
||||
@@ -60,6 +61,10 @@ class Management::Budgets::InvestmentsController < Management::BaseController
|
||||
check_verified_user t("management.budget_investments.alert.unverified_user")
|
||||
end
|
||||
|
||||
def load_budget
|
||||
@budget = Budget.find_by(slug: params[:budget_id]) || Budget.find_by(id: params[:budget_id])
|
||||
end
|
||||
|
||||
def load_categories
|
||||
@categories = ActsAsTaggableOn::Tag.category.order(:name)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user