Module: Sufia::FileSetsControllerBehavior

Extended by:
ActiveSupport::Concern
Includes:
Breadcrumbs
Included in:
CurationConcerns::FileSetsController
Defined in:
app/controllers/concerns/sufia/file_sets_controller_behavior.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Breadcrumbs

#build_breadcrumbs, #default_trail, #trail_from_referer

Class Method Details

.local_prefixesObject

This allows us to use the templates in curation_concerns/file_sets



39
40
41
# File 'app/controllers/concerns/sufia/file_sets_controller_behavior.rb', line 39

def self.local_prefixes
  ['curation_concerns/file_sets']
end

Instance Method Details

#add_breadcrumb_for_actionObject



28
29
30
31
32
33
34
35
36
# File 'app/controllers/concerns/sufia/file_sets_controller_behavior.rb', line 28

def add_breadcrumb_for_action
  case action_name
  when 'edit'.freeze
    add_breadcrumb I18n.t("sufia.file_set.browse_view"), main_app.curation_concerns_file_set_path(params["id"])
  when 'show'.freeze
    add_breadcrumb presenter.parent.to_s, main_app.polymorphic_path(presenter.parent)
    add_breadcrumb presenter.to_s, main_app.polymorphic_path(presenter)
  end
end

#add_breadcrumb_for_controllerObject



24
25
26
# File 'app/controllers/concerns/sufia/file_sets_controller_behavior.rb', line 24

def add_breadcrumb_for_controller
  add_breadcrumb I18n.t('sufia.dashboard.my.works'), sufia.dashboard_works_path
end

#citationObject

routed to /files/:id/citation



21
22
# File 'app/controllers/concerns/sufia/file_sets_controller_behavior.rb', line 21

def citation
end

#statsObject

routed to /files/:id/stats



16
17
18
# File 'app/controllers/concerns/sufia/file_sets_controller_behavior.rb', line 16

def stats
  @stats = FileUsage.new(params[:id])
end