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: documents_controller.rb
    path of file: ./repos/SimonSays/test/rails_app/app/controllers
    
    the code of the file until where you have to start completion: class DocumentsController < ApplicationController
  respond_to :json

  authenticate :user

  find_and_authorize :document, through: :memberships, only: :sh
    
  def update
    @document.update document_params

    respond_with @document
  end

  def destroy
    @document.destroy

    respond_with @document
  end

  def send_file
    send_data @document.title, filename: 'doc.txt'
  end

  protected

  def document_params
    params.require(:document).permit(:title)
  end
end