Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Accept arrays of symbols as values for collection/member actions of resources

#407

This will allow the values of collection/member hashes within a resource definition to be arrays of symbols. This is an alternative to supplying :any if a particular action needs, for instance, to be able to respond to a GET or POST request.

map.resources :messages, :collection => { :search => [:get, :post] }

Reported by Brennan Dunn · June 13th, 2008 @ 03:42 PM

State: resolved
Milestone: none
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: none

Activity

  1. Brennan Dunn
    Brennan Dunn

    E-mail typo in diff file

    June 13th, 2008 @ 03:45 PM

  2. Gaius Centus Novus
    Gaius Centus Novus

    This version only supports Resources; the solution should go deeper.

    -1 as is

    +1 for a version that allows non-resource multiple methods (see routes_with_method_array.diff)

    June 13th, 2008 @ 05:21 PM

  3. Ken Collins
    Ken Collins
    • 1 For anything that gives me the ability to use an array of methods. The [:get,:post] is a great example of a simple post back convention. I experienced this pain the other day while moving 1.2.6 app to resource based routes. So as far as I'm concerned the big help would be in resources but yes, I love the idea of having it in app route definitions.

    June 14th, 2008 @ 07:21 PM

  4. Jeremy Kemper
    Jeremy Kemper
    • Milestone cleared.
    • State changed from new to open
    • Assigned user set to Jeremy Kemper

    June 16th, 2008 @ 12:25 PM

  5. Jeremy Kemper
    Jeremy Kemper
    • Tag set to actionpack, patch, routing, tested

    Looks good. Could you rebase against master?

    August 28th, 2008 @ 07:56 AM

  6. Brennan Dunn
    Brennan Dunn

    Jeremy, updated my patch against the latest master.

    August 28th, 2008 @ 12:37 PM

  7. Brennan Dunn
    Brennan Dunn

    Jeremy, attached is both my original patch and Gaius' reworked for master.

    August 28th, 2008 @ 12:57 PM

  8. Repository
    Repository
    • State changed from open to resolved

    (from [9cc8c0a0a18163fb6ae0f66b2513c902d19459dc]) Routes may be restricted to lists of HTTP methods instead of a single method or :any.

    [#407 Accept arrays of symbols as values for collection/member actions of resources state:resolved]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

    August 28th, 2008 @ 08:38 PM