adds budget's groups & headings to admin
This commit is contained in:
15
app/controllers/admin/budget_groups_controller.rb
Normal file
15
app/controllers/admin/budget_groups_controller.rb
Normal file
@@ -0,0 +1,15 @@
|
||||
class Admin::BudgetGroupsController < Admin::BaseController
|
||||
|
||||
def create
|
||||
@budget = Budget.find params[:budget_id]
|
||||
@budget.groups.create(budget_group_params)
|
||||
@groups = @budget.groups.includes(:headings)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def budget_group_params
|
||||
params.require(:budget_group).permit(:name)
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user