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: controllers.rb
    path of file: ./repos/jsonapi-utils/spec/support
    
    the code of the file until where you have to start completion: require 'support/exceptions'

class BaseController < ActionController::Base
  include JSONAPI::Utils
  protect_from_forgery with: :null_session
  rescue_from ActiveRecord::RecordNotFound, with: :jsonapi_render_not_found
end

class PostsController < BaseController
  before_action :load_user, only: %i(index get_related_resources)

  # GET /users/:user_id/posts
  def index
    jsonapi_render json: @user.posts, optio
    
  def get_related_resources
    if params[:source] == "users" && params[:relationship] == "posts"
      # Example for custom method to fetch related resources
      @posts = @user.posts

      jsonapi_render json: @posts, options: {
        source: (params[:use_resource] == "true") ? UserResource.new(@user, context) : @user,
        relationship: (params[:explicit_relationship] == "true") ? 'posts' : nil
      }
    else
      # handle other requests with default method
      process_request
    end