This project is archived and is in readonly mode.
[PATCH] New Feature - grouped_collection_select
Reported by Codeape | October 22nd, 2008 @ 02:38 PM | in 2.3.4
The disconnect between collection_select and option_groups_from_collection_for_select has been bugging me for some time, so I thought I'd quickly do something about it.
grouped_collection_select provides the same functionality as collection_select(object, method, collection), but uses the semantics and has the same output as option_groups_from_collection_for_select.
Example: grouped_collection_select(:destination, :country_id, @continents, :countries, :name, :id, :name)
It's not major, but I thought I'd quickly throw it in, hopefully someone finds it useful enough. Patch contains implementation, tests and doc, developed against Edge
Comments and changes to this ticket
-
Amos King December 16th, 2008 @ 02:39 PM
- Tag changed from feature, formoptionshelper to actionview, enhancement, formoptionshelper, patch
I think the attempt to make the api consistent is great, and it sure is a lot less typing. You also documented and tested. You get my vote. +1
-
Travis Briggs March 10th, 2009 @ 04:23 AM
I applied the patch, verified the functionality, and added a line to the doc showing the 'old' way of accomplishing the same thing.
Everything looks good to me.
-
Mike Breen August 10th, 2009 @ 01:12 AM
- Assigned user set to Pratik
- Tag changed from actionview, enhancement, formoptionshelper, patch to actionview, bugmash, enhancement, formoptionshelper, patch
+1 for this change and I have verified that this patch applies cleanly to master.
-
Mike Breen August 10th, 2009 @ 01:24 AM
sorry, this does not apply cleanly to master:
error: patch failed: actionpack/test/template/form_options_helper_test.rb:681
error: actionpack/test/template/form_options_helper_test.rb: patch does not apply -
Erik Ostrom August 10th, 2009 @ 03:20 AM
It didn't apply cleanly, only because some of the surrounding code had changed. I've attached a new patch, which is just Codeape's original patch semi-manually reapplied and rediffed. (The patch retains Codeape's authorship.)
-
Rizwan Reza August 10th, 2009 @ 03:25 AM
- Tag changed from actionview, bugmash, enhancement, formoptionshelper, patch to actionview, bugmash, enhancement, formoptionshelper, patch, verified
- Title changed from New Feature - grouped_collection_select to [PATCH] New Feature - grouped_collection_select
verified
+1 This is a nice addition. The patch applies cleanly and all tests pass.
-
Josh Nichols August 10th, 2009 @ 03:32 AM
- Tag changed from actionview, bugmash, enhancement, formoptionshelper, patch, verified to actionview, bugmash, enhancement, formoptionshelper, patch
- Title changed from [PATCH] New Feature - grouped_collection_select to New Feature - grouped_collection_select
Verified the updated patch applies to master.
+1 on the functionality, but I'd like to see some example HTML output it produces.
-
Erik Ostrom August 10th, 2009 @ 04:10 AM
- Tag changed from actionview, bugmash, enhancement, formoptionshelper, patch to actionview, bugmash, enhancement, formoptionshelper, patch, verified
- Title changed from New Feature - grouped_collection_select to [PATCH] New Feature - grouped_collection_select
New patch. At Josh Nichols's suggestion, added sample output to the documentation, and used %Q{} to make the test a little more legible.
-
Erik Ostrom August 10th, 2009 @ 04:10 AM
New patch. At Josh Nichols's suggestion, added sample output to the documentation, and used %Q{} to make the test a little more legible.
-
Ed Ruder August 10th, 2009 @ 06:06 AM
Verified.
+1 this patch applies cleanly on 2-3-stable and all tests pass.
-
Derander August 10th, 2009 @ 07:07 AM
+1 verified patch applies to master.
This is a good idea, API consistency is A Good Thing™.
-
Repository August 10th, 2009 @ 08:02 AM
- State changed from new to committed
(from [9a42096e958cbce805ad9b6f35c5f03fe4775855]) Introduce grouped_collection_select helper.
[#1249 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/9a42096e958cbce805ad9b6f35c5f0... -
Repository August 10th, 2009 @ 08:02 AM
(from [8c32248acbd71f7906a037fad499e2f8cae61bed]) Introduce grouped_collection_select helper.
[#1249 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/8c32248acbd71f7906a037fad499e2... -
Jeremy Kemper August 10th, 2009 @ 08:02 AM
- Tag changed from actionview, bugmash, enhancement, formoptionshelper, patch, verified to actionview, enhancement, formoptionshelper, patch, verified
- Milestone changed from 2.x to 2.3.4
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 1249 [PATCH] New Feature - grouped_collection_select [#1249 state:committed]
- 1249 [PATCH] New Feature - grouped_collection_select [#1249 state:committed]