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_controller.rb

25 lines
497 B
Ruby

# frozen_string_literal: true
class Staffs::AccountsController < ApplicationController
before_action :set_account, except: :index
# GET /staff/accounts
def index
authorize %i[staff account]
@accounts = policy_scope(
Account,
policy_scope_class: Staff::AccountPolicy::Scope,
)
end
# GET /staff/accounts/:nickname
def show
authorize [:staff, @account]
end
private
def set_account
@account = Account.find_by! nickname: params[:nickname]
end
end