mirror of https://github.com/docusealco/docuseal
				
				
				
			
			You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					
					
						
							28 lines
						
					
					
						
							785 B
						
					
					
				
			
		
		
	
	
							28 lines
						
					
					
						
							785 B
						
					
					
				# frozen_string_literal: true
 | 
						|
 | 
						|
class SubmissionsDebugController < ApplicationController
 | 
						|
  layout 'form'
 | 
						|
 | 
						|
  skip_before_action :authenticate_user!
 | 
						|
 | 
						|
  def index
 | 
						|
    @submission = Submission.preload({ attachments_attachments: :blob },
 | 
						|
                                     template: { documents_attachments: :blob })
 | 
						|
                            .find_by(slug: params[:submission_slug])
 | 
						|
 | 
						|
    respond_to do |f|
 | 
						|
      f.html do
 | 
						|
        render 'submit_template/show'
 | 
						|
      end
 | 
						|
      f.pdf do
 | 
						|
        Submissions::GenerateResultAttachments.call(@submission)
 | 
						|
 | 
						|
        send_data ActiveStorage::Attachment.where(name: :documents).last.download,
 | 
						|
                  filename: 'debug.pdf',
 | 
						|
                  disposition: 'inline',
 | 
						|
                  type: 'application/pdf'
 | 
						|
      end
 | 
						|
    end
 | 
						|
  end
 | 
						|
end
 |