Skip to content

Migrating to hydra head 6.0

David Chandek-Stark edited this page Feb 18, 2014 · 1 revision
  class DownloadsController < ApplicationController
    include Hydra::Controller::DownloadBehavior
  end

then in config/routes.rb add resources :downloads

then you can do a GET /downloads/{pid}?datastream_id=thumbnail to get the thumbnail datastream

By default this allows any user with read access to the object identified by pid to download any of the datatreams. If you want to control which datastreams a user has access to, overwrite the can_download? method.

This example allows anyone to download a 'thumbnail' datastream:

  def can_download?
    datastream.dsid == 'thumbnail'
  end
  • The default control group changed from Inline (X) to Managed (M). If you want to retain the current configuration add: :control_group=>'X' to any has_metadata declarations.
Clone this wiki locally