Module: Hyrax::FileSetsControllerBehavior
- Extended by:
- ActiveSupport::Concern
- Includes:
- Blacklight::AccessControls::Catalog, Blacklight::Base, Breadcrumbs
- Included in:
- FileSetsController
- Defined in:
- app/controllers/concerns/hyrax/file_sets_controller_behavior.rb
Instance Method Summary collapse
-
#citation ⇒ Object
routed to /files/:id/citation.
-
#create ⇒ Object
routed to /files (POST).
- #destroy ⇒ Object
-
#edit ⇒ Object
routed to /files/:id/edit.
-
#new ⇒ Object
routed to /files/new.
-
#show ⇒ Object
routed to /files/:id.
-
#stats ⇒ Object
routed to /files/:id/stats.
-
#update ⇒ Object
routed to /files/:id (PUT).
Methods included from Breadcrumbs
#build_breadcrumbs, #default_trail, #trail_from_referer
Instance Method Details
#citation ⇒ Object
routed to /files/:id/citation
82 |
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 82 def citation; end |
#create ⇒ Object
routed to /files (POST)
44 45 46 |
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 44 def create create_from_upload(params) end |
#destroy ⇒ Object
57 58 59 60 61 |
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 57 def destroy parent = curation_concern.parent actor.destroy redirect_to [main_app, parent], notice: 'The file has been deleted.' end |
#edit ⇒ Object
routed to /files/:id/edit
39 40 41 |
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 39 def edit initialize_edit_form end |
#new ⇒ Object
routed to /files/new
36 |
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 36 def new; end |
#show ⇒ Object
routed to /files/:id
49 50 51 52 53 54 55 |
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 49 def show respond_to do |wants| wants.html { presenter } wants.json { presenter } additional_response_formats(wants) end end |
#stats ⇒ Object
routed to /files/:id/stats
77 78 79 |
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 77 def stats @stats = FileUsage.new(params[:id]) end |
#update ⇒ Object
routed to /files/:id (PUT)
64 65 66 67 68 69 70 71 72 73 74 |
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 64 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 |