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/accounts/contacts_controller.rb

23 lines
530 B
Ruby

# frozen_string_literal: true
class Staffs::Accounts::ContactsController < ApplicationController
include PaginalController
before_action :set_account
# GET /staff/accounts/:account_nickname/contacts
def index
authorize [:staff, Account, Contact]
@contacts = policy_scope(
@account.contact_list.contacts,
policy_scope_class: Staff::Account::ContactPolicy::Scope,
).page(active_page)
end
private
def set_account
@account = Account.find_by! nickname: params[:account_nickname]
end
end