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

Methods included from Breadcrumbs

#build_breadcrumbs, #default_trail, #trail_from_referer

Instance Method Details

#citationObject

routed to /files/:id/citation



82
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 82

def citation; end

#createObject

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

#destroyObject



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

#editObject

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

#newObject

routed to /files/new



36
# File 'app/controllers/concerns/hyrax/file_sets_controller_behavior.rb', line 36

def new; end

#showObject

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

#statsObject

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

#updateObject

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.message
  logger.error "FileSetsController::update rescued #{error.class}\n\t#{error.message}\n #{error.backtrace.join("\n")}\n\n"
  render action: 'edit'
end