I thought rather than try to modify collection I'd rather declare a new method and then integrate into collection when ready.

-----Original Message-----
From: "Andrew White" <notifications@github.com>
Sent: ‎01-‎08-‎2013 02:24
To: "ujjwalt/rails" <rails@noreply.github.com>
Cc: "Ujjwal Thaakar" <ujjwalthaakar@gmail.com>
Subject: Re: [rails] Default Collection Routing (#1)

In actionpack/lib/action_dispatch/routing/mapper.rb:
> -              get  :index if parent_resource.actions.include?(:index)
> -              post :create if parent_resource.actions.include?(:create)
> +            if options[:bulk]
> +              bulk do
> +                constraints = {ids: /(?:[^\.\/\?]|\.\.)+/}
> +                get    :index, constraints if parent_resource.actions.include?(:index)
> +                put    :replace, constraints if parent_resource.actions.include?(:replace)
> +                post   :create, constraints if parent_resource.actions.include?(:create)
> +                patch  :update_many, constraints if parent_resource.actions.include?(:update_many)
> +                delete :destroy_many, constraints if parent_resource.actions.include?(:destroy_many)
> +              end
> +            else
> +              collection do
> +                get    :index if parent_resource.actions.include?(:index)
> +                post   :create if parent_resource.actions.include?(:create)
> +              end
As I wrote elsewhere this block just needs to be done as collection
—
Reply to this email directly or view it on GitHub.