Module: Cul::Hydra::Controllers::Helpers::HydraUploaderHelperBehavior
- Defined in:
- lib/cul_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb
Instance Method Summary collapse
- #asset_id ⇒ Object
- #container_id ⇒ Object
-
#upload_url(in_place = false) ⇒ Object
Generate the appropriate url for posting uploads to Uses the
container_id
method to figure out what container uploads should go into.
Instance Method Details
#asset_id ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cul_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb', line 14 def asset_id if !params[:asset_id].nil? return params[:asset_id] else return params[:id] end end |
#container_id ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/cul_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb', line 24 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 |
#upload_url(in_place = false) ⇒ Object
Generate the appropriate url for posting uploads to Uses the container_id
method to figure out what container uploads should go into
6 7 8 9 10 11 12 |
# File 'lib/cul_hydra/controllers/helpers/hydra_uploader_helper_behavior.rb', line 6 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 |