Sha256: acc4efd591b48791d3eb0a84969f3d2eebdb7ddec5a3180b1bf6bb6a8e986c57

Contents?: true

Size: 817 Bytes

Versions: 7

Compression:

Stored size: 817 Bytes

Contents

# -*- encoding : utf-8 -*-
module Hydra
  module BatchEdit
    class Routes

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

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

      protected

      def add_routes &blk
        @router.instance_exec(@options, &blk)
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
hydra-batch-edit-1.0.1 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-1.0.0 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-0.3.1 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-0.3.0 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-0.2.0 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-0.1.0 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-0.0.7 lib/hydra/batch_edit/routes.rb