Sha256: a0c5a4ae79ab3a593ca9d72314efe3d47f8406db50c10c764b5294ea6535dec7

Contents?: true

Size: 713 Bytes

Versions: 3

Compression:

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

3 entries across 3 versions & 1 rubygems

Version Path
hydra-batch-edit-0.0.4 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-0.0.3 lib/hydra/batch_edit/routes.rb
hydra-batch-edit-0.0.2 lib/hydra/batch_edit/routes.rb