1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/controllers/staffs/org_units_controller.rb

25 lines
495 B
Ruby

# frozen_string_literal: true
class Staffs::OrgUnitsController < ApplicationController
before_action :set_org_unit, only: :show
# GET /staff/org_units
def index
authorize [:staff, OrgUnit]
@org_units = policy_scope(
OrgUnit,
policy_scope_class: Staff::OrgUnitPolicy::Scope,
).page(params[:page])
end
# GET /staff/org_units/:id
def show
authorize [:staff, @org_unit]
end
private
def set_org_unit
@org_unit = OrgUnit.find params[:id]
end
end