Class: Hyrax::FileSetsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Hyrax::FileSetsController
- Includes:
- Blacklight::AccessControls::Catalog, Blacklight::Base, Breadcrumbs
- Defined in:
- app/controllers/hyrax/file_sets_controller.rb
Instance Attribute Summary collapse
-
#file_set ⇒ Object
(also: #curation_concern)
readonly
A little bit of explanation, CanCan(Can) sets the @file_set via the .load_and_authorize_resource method.
Instance Method Summary collapse
-
#citation ⇒ Object
GET /files/:id/citation.
-
#destroy ⇒ Object
DELETE /concern/file_sets/:id.
-
#edit ⇒ Object
GET /concern/file_sets/:id.
-
#show ⇒ Object
GET /concern/parent/:parent_id/file_sets/:id.
-
#stats ⇒ Object
GET /files/:id/stats.
-
#update ⇒ Object
PATCH /concern/file_sets/:id.
Methods included from Breadcrumbs
#build_breadcrumbs, #default_trail, #trail_from_referer
Instance Attribute Details
#file_set ⇒ Object Also known as: curation_concern
A little bit of explanation, CanCan(Can) sets the @file_set via the .load_and_authorize_resource method. However the interface for various CurationConcern modules leverages the #curation_concern method Thus we have file_set and curation_concern that are aliases for each other.
24 25 26 |
# File 'app/controllers/hyrax/file_sets_controller.rb', line 24 def file_set @file_set end |
Instance Method Details
#citation ⇒ Object
GET /files/:id/citation
73 |
# File 'app/controllers/hyrax/file_sets_controller.rb', line 73 def citation; end |
#destroy ⇒ Object
DELETE /concern/file_sets/:id
48 49 50 51 52 |
# File 'app/controllers/hyrax/file_sets_controller.rb', line 48 def destroy parent = curation_concern.parent actor.destroy redirect_to [main_app, parent], notice: 'The file has been deleted.' end |
#edit ⇒ Object
GET /concern/file_sets/:id
34 35 36 |
# File 'app/controllers/hyrax/file_sets_controller.rb', line 34 def edit initialize_edit_form end |
#show ⇒ Object
GET /concern/parent/:parent_id/file_sets/:id
39 40 41 42 43 44 45 |
# File 'app/controllers/hyrax/file_sets_controller.rb', line 39 def show respond_to do |wants| wants.html { presenter } wants.json { presenter } additional_response_formats(wants) end end |
#stats ⇒ Object
GET /files/:id/stats
68 69 70 |
# File 'app/controllers/hyrax/file_sets_controller.rb', line 68 def stats @stats = FileUsage.new(params[:id]) end |
#update ⇒ Object
PATCH /concern/file_sets/:id
55 56 57 58 59 60 61 62 63 64 65 |
# File 'app/controllers/hyrax/file_sets_controller.rb', line 55 def update if attempt_update after_update_response else after_update_failure_response end rescue RSolr::Error::Http => error flash[:error] = error. logger.error "FileSetsController::update rescued #{error.class}\n\t#{error.}\n #{error.backtrace.join("\n")}\n\n" render action: 'edit' end |