This project is archived and is in readonly mode.
select_tag should allow :include_blank option
Reported by Clemens Kofler | February 16th, 2009 @ 12:22 PM | in 3.x
I think that "select_tag" should allow the :include_blank just like its object-related sibling "select" does. This makes it much easier to construct forms in a not strictly object-related context.
Examples:
<%= select_tag "country", %(<option
value=""></option>) + options_for_select(Country.all)
%>
would become
<%= select_tag "country",
options_for_select(Country.all), :include_blank => true
%>
<%= select_tag "country", %(<option
value="">any</option>) + options_for_select(Country.all)
%>
would become
<%= select_tag "country",
options_for_select(Country.all), :include_blank => "any"
%>
A patch including tests is attached.
Comments and changes to this ticket
-
Jason Arora March 22nd, 2009 @ 11:52 PM
+1
The patch and tests look good. A useful and logical addition.
-
Rizwan Reza August 8th, 2009 @ 03:31 PM
verified
+1 This is a very useful addition. One that is manually tweaked as mentioned. The above patch didn't apply for 2-3-stable or master. So I have recreated with updated tests.
-
Matt Duncan August 8th, 2009 @ 05:31 PM
+1 this is a very logical addition, Rizwan's patch applies cleanly with tests passing
-
Repository August 8th, 2009 @ 07:09 PM
(from [1191e3ffaf7ced4155eb6c2b1661e27d7851ca9a]) Add :include_blank option for select_tag [#1987 status:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
Signed-off-by: Pratik Naik pratiknaik@gmail.com
http://github.com/rails/rails/commit/1191e3ffaf7ced4155eb6c2b1661e2... -
Tim Harvey December 9th, 2009 @ 04:01 PM
Please excuse me if there is an obvious answer to this question that I've missed...
This is a terrific addition, but I don't find this patch in the latest 2.3.5 release. Did it somehow get passed over by mistake, or do patches take time to be incorporated? It would seem that the commit into the Rails repo would finalize the change and make it available upon the next release.
Am I missing something?
-
Rizwan Reza June 19th, 2010 @ 05:07 AM
- State changed from new to resolved
Tim, I think 2.3.x is being supported for bug fixes only... that's why.
-
xhming July 19th, 2010 @ 07:34 AM
- Importance changed from to
bags care replica handbags store stand for empitic dominion replica Jimmy Choo handbags sale a idiosyncrasy of colors replica Gucci Wallet sale again styles congruous to high quality replica handbags the play of wholesale replica Marc Jacobs handbags handbags for cheap replica handbags replica Street sale replica hadnbags online replica handbags
-
xiannv September 3rd, 2010 @ 01:35 AM
ovado Stratus chronograph watch for men has round black dial date display wholesale watches stainless steel bracelet etc is something men will want to own fake watches When its time to hit the surf the ESQ Movado 07301080 Mens Tournament Blue Dial Watch will be joining you replica watches Water resistant to 300 feet fake watches makes it an ideal companion for swimming or snorkeling or other water sports A magnified date window sits at 3 oclock The stainless steel bracelet has a push button folding clasp A blue textured
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
- 1987 select_tag should allow :include_blank option (from [1191e3ffaf7ced4155eb6c2b1661e27d7851ca9a]) Add :in...