You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: staffs_controller.rb
    path of file: ./repos/annict/app/controllers/db
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module Db
  class StaffsController < Db::ApplicationController
    before_action :authenticate_user!, only: %i[new create edit update destroy]

    def index
      @work = Work.without_deleted.find(params[:work_id])
      @staffs = @work
      
    
    def index
      @work = Work.without_deleted.find(params[:work_id])
      @staffs = @work
        .staffs
        .without_deleted
        .includes(:resource)
        .order(:sort_number)
      @staffs_csv = @staffs.map do |staff|
        str = staff.decorate.role_name
        case staff.resource_type
        when "Person"
          str += ",#{staff.resource.name}"
        when "Organization"
          str += ",,#{staff.resource.name}"
        end
        str
      end.join("\n")
    end