Class: ActionDispatch::Routing::Mapper

Inherits:
Object
  • Object
show all
Defined in:
lib/curation_concerns/rails/routes.rb

Instance Method Summary collapse

Instance Method Details

#curation_concerns_basic_routesObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/curation_concerns/rails/routes.rb', line 3

def curation_concerns_basic_routes
  resources :downloads, only: :show
  resources :upload_sets, only: [:edit, :update]

  namespace :curation_concerns, path: :concern do
    CurationConcerns.config.registered_curation_concern_types.map(&:tableize).each do |curation_concern_name|
      namespaced_resources curation_concern_name, except: [:index]
    end

    resources :permissions, only: [] do
      member do
        get :confirm
        post :copy
      end
    end
    resources :file_sets, only: [:new, :create], path: 'container/:parent_id/file_sets'
    resources :file_sets, only: [:show, :edit, :update, :destroy] do
      member do
        get :versions
        put :rollback
      end
    end
  end
end

#curation_concerns_collectionsObject

Used in conjunction with Hydra::Collections::Engine routes. Adds routes for doing paginated searches within a collection’s contents

Examples:

in routes.rb:

mount Hydra::Collections::Engine => '/'
curation_concerns_collections


33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/curation_concerns/rails/routes.rb', line 33

def curation_concerns_collections
  resources :collections, only: :show do
    member do
      get 'page/:page', action: :index
      get 'facet/:id', action: :facet, as: :dashboard_facet
    end
    collection do
      put '', action: :update
      put :remove_member
    end
  end
end

#curation_concerns_embargo_managementObject

kmr added :show to make tests pass



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/curation_concerns/rails/routes.rb', line 47

def curation_concerns_embargo_management
  resources :embargoes, only: [:index, :edit, :destroy] do
    collection do
      patch :update
    end
  end
  resources :leases, only: [:index, :edit, :destroy] do
    collection do
      patch :update
    end
  end
end