Sha256: c02841c0291103598520ed3bb4889c0c68ccc21260bc086738a3b1f1d2fe4b61

Contents?: true

Size: 604 Bytes

Versions: 29

Compression:

Stored size: 604 Bytes

Contents

module ActionDispatch::Routing
  class Mapper
    # Add two collection routes to the normal resources definition.
    # This call behaves exactly as the normal resources :... call, 
    # but adds:
    #   collection do
    #     get :collection_edit
    #     post :collection_update
    #   end
    def collection_resources(*resources, &blk)
      collection_blk = Proc.new do
        collection do
          get :collection_edit
          match :collection_update, via: [:post, :patch, :put]
        end
        blk.call if blk
      end
      resources(*resources, &collection_blk)
    end
  end
end

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
record_collection-0.10.4 lib/record_collection/rails/routes.rb
record_collection-0.10.3 lib/record_collection/rails/routes.rb
record_collection-0.10.2 lib/record_collection/rails/routes.rb
record_collection-0.10.1 lib/record_collection/rails/routes.rb
record_collection-0.10.0 lib/record_collection/rails/routes.rb
record_collection-0.9.2 lib/record_collection/rails/routes.rb
record_collection-0.9.1 lib/record_collection/rails/routes.rb
record_collection-0.9.0 lib/record_collection/rails/routes.rb
record_collection-0.8.3 lib/record_collection/rails/routes.rb
record_collection-0.8.2 lib/record_collection/rails/routes.rb
record_collection-0.8.1 lib/record_collection/rails/routes.rb
record_collection-0.7.5 lib/record_collection/rails/routes.rb
record_collection-0.7.4 lib/record_collection/rails/routes.rb
record_collection-0.7.3 lib/record_collection/rails/routes.rb
record_collection-0.7.2 lib/record_collection/rails/routes.rb
record_collection-0.7.1 lib/record_collection/rails/routes.rb
record_collection-0.7.0 lib/record_collection/rails/routes.rb
record_collection-0.6.1 lib/record_collection/rails/routes.rb
record_collection-0.6.0 lib/record_collection/rails/routes.rb
record_collection-0.5.3 lib/record_collection/rails/routes.rb