Class: Hydra::BatchEdit::Routes

Inherits:
Object
  • Object
show all
Defined in:
lib/hydra/batch_edit/routes.rb

Instance Method Summary collapse

Constructor Details

#initialize(router, options) ⇒ Routes

Returns a new instance of Routes.


6
7
8
9
# File 'lib/hydra/batch_edit/routes.rb', line 6

def initialize(router, options)
  @router = router
  @options = options
end

Instance Method Details

#drawObject


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/hydra/batch_edit/routes.rb', line 11

def draw
  add_routes do |options|
    resources :batch_edits, :only=>[:index] do
      member do
        delete :destroy
      end
      collection do
        get :index
        get :edit
        put :update
        delete :clear
        put :state
        put :all
      end
    end
    match 'batch_edits/:id' => 'batch_edits#add', :via=>:put
    match 'batch_edits' => 'batch_edits#destroy_collection', :via=>:delete
  end
end