Sha256: 7524c6cdb16863b777075a4c74f9bff9c734fca5ee2d976623825dcee5daf486

Contents?: true

Size: 736 Bytes

Versions: 2

Compression:

Stored size: 736 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
              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

2 entries across 2 versions & 1 rubygems

Version Path
hydra-batch-edit-0.0.6 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-0.0.5 lib/hydra/batch_edit/routes.rb