Use find instead of find_by_id
Better raise a 404 HTML NotFound exception than any other unexpected error.
This commit is contained in:
committed by
Javi Martín
parent
22076dd95c
commit
b122302c58
@@ -46,11 +46,11 @@ class Admin::BudgetGroupsController < Admin::BaseController
|
||||
private
|
||||
|
||||
def load_budget
|
||||
@budget = Budget.includes(:groups).find(params[:budget_id])
|
||||
@budget = Budget.find_by_slug_or_id! params[:budget_id]
|
||||
end
|
||||
|
||||
def load_group
|
||||
@group = @budget.groups.find(params[:id])
|
||||
@group = @budget.groups.find_by_slug_or_id! params[:id]
|
||||
end
|
||||
|
||||
def groups_index
|
||||
|
||||
Reference in New Issue
Block a user