Class: DownloadsController

Inherits:
ApplicationController show all
Includes:
Sufia::Noid
Defined in:
app/controllers/downloads_controller.rb

Instance Method Summary collapse

Methods inherited from ApplicationController

#show_action_bar?, #show_site_search?, #sufia

Instance Method Details

#generic_fileObject



6
7
8
# File 'app/controllers/downloads_controller.rb', line 6

def generic_file
  @generic_file ||= GenericFile.find(params[:id])
end

#showObject



13
14
15
16
17
18
19
20
# File 'app/controllers/downloads_controller.rb', line 13

def show
  send_data(
    generic_file.content.content,
    type: generic_file.content.mimeType,
    filename: generic_file.filename,
    disposition: 'inline'
  )
end