Sha256: 92e70f34e1e08bf2d33dfeec086fca4635cff72b02f99af6a346037951282e59

Contents?: true

Size: 935 Bytes

Versions: 4

Compression:

Stored size: 935 Bytes

Contents

class DownloadsController < ApplicationController
    include Hydra::Controller::RepositoryControllerBehavior
    include Hydra::AssetsControllerHelper
    helper :downloads
    
    # Note: Actual downloads are handled by the index method insead of the show method
    # in order to avoid ActionController being clever with the filenames/extensions/formats.
    # To download a datastream, pass the datastream id as ?document_id=#{dsid} in the url
    def index
      ActiveSupport::Deprecation.warn("DownloadsController is deprecated. Please use FileAssetsController or create a model specific DownloadsController in your own hydra-head.")
      fedora_object = ActiveFedora::Base.find(params[:asset_id])
      if params[:download_id]
        @datastream = fedora_object.datastreams[params[:download_id]]
        send_datastream @datastream
      else
        @datastreams = downloadables( fedora_object )
      end
    end
    
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
hydra-head-4.1.3 app/controllers/downloads_controller.rb
hydra-head-4.1.2 app/controllers/downloads_controller.rb
hydra-head-4.1.1 app/controllers/downloads_controller.rb
hydra-head-4.1.0 app/controllers/downloads_controller.rb