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: organizations_controller.rb
    path of file: ./repos/forem/app/controllers/api/v1
    
    the code of the file until where you have to start completion: module Api
  module V1
    class OrganizationsController < ApiController
      include Api::OrganizationsController
      before_action :find_o
    
      def index
        per_page = (params[:per_page] || 30).to_i
        num = [per_page, per_page_max].min
        page = params[:page] || 1

        organizations = Organization.select(INDEX_ATTRIBUTES_FOR_SERIALIZATION).page(page).per(num)

        render json: organizations
      end