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

28 lines
522 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Staffs::OrgUnitsController < ApplicationController
2020-01-04 13:51:32 -05:00
include PaginalController
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,
2020-01-04 13:51:32 -05:00
).page(active_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