Class: IiifPrint::SplitPdfsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/iiif_print/split_pdfs_controller.rb

Overview

Responsible for coordinating the request to resplit a PDF.

Instance Method Summary collapse

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/iiif_print/split_pdfs_controller.rb', line 6

def create
  @file_set = IiifPrint.find_by(id: params[:file_set_id])
  authorize_create_split_request!(@file_set)

  IiifPrint::Jobs::RequestSplitPdfJob.perform_later(file_set_id: @file_set.to_param, user: current_user)
  respond_to do |wants|
    wants.html { redirect_to polymorphic_path([main_app, @file_set]), notice: t("iiif_print.file_set.split_submitted", id: @file_set.id) }
    wants.json { render json: { id: @file_set.id, to_param: @file_set.to_param }, status: :ok }
  end
end