This project is archived and is in readonly mode.
support of html Attributes for options_for_select
-
Steve St. Martin
- Assigned user set to Ryan Bigg
Verified on 2.3.5, Please submit a valid patch http://guides.rails.info/contributing_to_rails.html#create-a-patch.
Can be marked as incomplete.
-
Ryan Bigg
- State changed from new to incomplete
Seems like a great patch. Please format this patch in the suggested way.
-
Marc Lainez
- Tag changed from action_view, feature, feature_request, form_options_helper to action_view, feature, feature_request, form_options_helper, patch
Useful indeed Joshaven, I made a patch including your changes and tests. Tell me if it needs to be reworked.
-
Joshaven Potter
Sorry, I have not been working with Rails much for the last few months. I am happy that you guys are taking this and running with it!
-
Dan Pickett
- Tag changed from action_view, feature, feature_request, form_options_helper, patch to action_view, bugmash, feature, feature_request, form_options_helper, patch
Marc, was the patch you supplied made against master or 2-3-stable?
Can bugmashers apply this and check if it cleanly applies to master?
-
Marc Lainez
It was made against the master branch.
-
Jared Pace
We verified this patch against master, and noticed there were no docs added. So we added some documentation and have attached a revised patch.
One note of feedback: the method
html_attributes_fromis pretty complicated, and we thought it should be simplified if at all possible. Also the fact that Marc's original code added threeNOTEs smells a little bad to us, maybe that could be cleaned up with explaining methods?- Rob and Jared @ Relevance
-
Santiago Pastorino
- State changed from incomplete to open
- Assigned user changed from Ryan Bigg to José Valim
Tickets should be new or open if they are being discussed
-
José Valim
@Jared, I agree. The code can be improved and the to_a call should also be removed (use Array.wrap instead). Anyone willing to improve it, can consider that Jared's patch above will be applied and you can apply your fixes on top of it.
-
pleax
I’ve attached a patch with few more test-cases and slightly different approach to implementation.
-
PacoGuzman
+1
All test pass, enough test cases and clean implementation
-
Anil Wadghule
+1 Patch applies cleanly. Tests pass. It is an useful feature to have.
-
jslag
Paco and Anil, which patch are you referring to? pleax's?
-
jslag
+1 to pleax's 2165-html_attributes_in_options_for_select.diff
- verified that it still applies cleanly to master
- function name 'option_html_attributes' is more internally consistent
- patching option_text_and_value to handle the potential addition of Hashes is cleaner than the original patch's changes in options_for_select
-
Neil Cook
+1 Patch 2165-html_attributes_in_options_for_select.diff from pleax applies cleanly. Tests pass.
-
Enrico Bianco
+1, applies cleanly to current master, tests pass, comprehensive tests and documentation.
-
Repository
(from [2dc1402417242784a738321e7edd521f8ec7ac83]) added support for html attributes in options_for_select [#2165 support of html Attributes for options_for_select]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/2dc1402417242784a738321e7edd52... -
José Valim
- State changed from open to resolved
