Files
nairobi/app/controllers/budgets/groups_controller.rb
Julian Herrero b122302c58 Use find instead of find_by_id
Better raise a 404 HTML NotFound exception than any other unexpected error.
2019-06-03 17:54:19 +02:00

24 lines
622 B
Ruby

module Budgets
class GroupsController < ApplicationController
before_action :load_budget
before_action :load_group
load_and_authorize_resource :budget
load_and_authorize_resource :group, class: "Budget::Group"
before_action :set_default_budget_filter, only: :show
has_filters %w[not_unfeasible feasible unfeasible unselected selected winners], only: [:show]
def show
end
private
def load_budget
@budget = Budget.find_by_slug_or_id! params[:budget_id]
end
def load_group
@group = @budget.groups.find_by_slug_or_id! params[:id]
end
end
end