Accept arrays of symbols as values for collection/member actions of resources
Reported by Brennan Dunn | June 13th, 2008 @ 09:42 AM | in 2.2
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] }
Comments and changes to this ticket
-
-

Gaius Centus Novus June 13th, 2008 @ 11:21 AM
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)
-
Ken Collins June 14th, 2008 @ 01:21 PM
- 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.
-
Jeremy Kemper June 16th, 2008 @ 06:25 AM
- → State changed from new to open
- → Assigned user changed from to Jeremy Kemper
- → Milestone changed from to 2.2
-
Jeremy Kemper August 28th, 2008 @ 01:56 AM
- → Tag changed from to actionpack patch routing tested
Looks good. Could you rebase against master?
-
-
Brennan Dunn August 28th, 2008 @ 06:57 AM
Jeremy, attached is both my original patch and Gaius' reworked for master.
-

Repository August 28th, 2008 @ 02:38 PM
- → 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 state:resolved]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
Source available from github
The Git repository resides at http://github.com/rails
Check out the current development trunk (Edge Rails) with:
git clone git://github.com/rails/rails.git
The latest development for the 1.2.x and 2.0.x releases are on the 1-2-stable and 2-0-stable branches.
Creating a bug report
When creating a bug report, be sure to include as much relevant information as possible. Post the code sample that causes the problem. Preferably, alter the unit tests and show through either changed or added tests how the expected behavior is not occuring.
Security vulnerabilities should be reported via an email to security@rubyonrails.org, do not use trac for reporting security vulnerabilities. All content in trac is publicly available as soon as it is posted.
Then don't get your hopes up. Unless you have a "Code Red, Mission Critical, The World is Coming to an End" kinda bug, you're creating this ticket in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the ticket automatically will see any activity or that others will jump to fix it. Creating a ticket like this is mostly to help yourself start on the path of fixing the problem and for others to sign on to with a "I'm having this problem too".
