Sha256: 6c0359bdc44f0cc61ae17add82c209f5f4d5b424b2c578e35ed33fcc814199d2

Contents?: true

Size: 974 Bytes

Versions: 69

Compression:

Stored size: 974 Bytes

Contents

module Cul::Scv::Hydra::Controllers::Helpers
module HydraUploaderHelperBehavior
  
  # Generate the appropriate url for posting uploads to
  # Uses the +container_id+ method to figure out what container uploads should go into
  def upload_url(in_place=false)
    if in_place
      upload_url = asset_datastream_path(:asset_id=>container_id, :id=>'CONTENT')
    else
      upload_url = asset_resources_path(:container_id=>container_id)
    end
  end
  
  def asset_id
    if !params[:asset_id].nil?
      return params[:asset_id]
    else
      return params[:id]
    end
  end

  # The id of the container that uploads should be posted into
  # If params[:container_id] is not set, it uses params[:id] (assumes that you're uploading items into the current object)
  def container_id
    if !params[:container_id].nil?
      return params[:container_id]
    elsif !params[:asset_id].nil?
      return params[:asset_id]
    else
      return params[:id]
    end
  end
end
end

Version data entries

69 entries across 69 versions & 1 rubygems

Version Path
cul_scv_hydra-0.16.3 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.16.2 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.16.1 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.16.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.15.1 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.15.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.14.2 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.14.1 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.14.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.13.3 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.12.1 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.12.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.11.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.10.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.9.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.8.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.7.0 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.6.4 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.6.3 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
cul_scv_hydra-0.6.2 lib/cul_scv_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb