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