This project is archived and is in readonly mode.
[PATCH] collection_select not displaying :prompt when value present
Reported by Andrew Selder | May 8th, 2008 @ 08:03 PM
I have form that has the following line:
Parking 
 <%= ps.collection_select 'ext_parking_id', @parking_options, :id, :name, :prompt => '- Choose Parking Type -' %> 
If the ext_parking_id field has no value the prompt displays as expected. However, if a value is present, only the options are present, with no prompt. This is in direct contradiction to the api documentation example. (http://api.rubyonrails.org/class...)
HTML with value present: Parking 
 Direct Access Single Full Tandem Garage Street Parking Lot Valet 
HTML with no value present: Parking 
 - Choose Parking Type - Direct Access Single Full Tandem Garage Street Parking Lot Valet 
Rails 2.0.2, Ruby 1.8.6_p110, Mac OS X 10.5.1
Thanks,
Andrew
(just transferring over from Trac)
Comments and changes to this ticket
- 
        

Pratik May 13th, 2008 @ 02:14 PM
- Title changed from [PATCH] collection_select not displaying :prompt when value present to collection_select not displaying :prompt when value present
 
 - 
        

Pratik May 13th, 2008 @ 02:25 PM
- State changed from new to incomplete
 
The uploaded patch seems garbled. Could you please upload a new patch ?
Thanks.
 - 
            
        

 - 
            
        

Andrew Selder August 12th, 2008 @ 09:29 PM
- Title changed from collection_select not displaying :prompt when value present to [PATCH] collection_select not displaying :prompt when value present
 - Tag set to actionpack, collection_select, patch
 
 - 
        

CancelProfileIsBroken August 3rd, 2009 @ 03:03 PM
- Tag changed from actionpack, collection_select, patch to actionpack, bugmash, collection_select, patch
 
 - 
            
        

Cristi Balan August 8th, 2009 @ 04:24 PM
-1
The documentation says that :prompt is only added when there is no value present.
The option :include_blank should be used for the behaviour described by the reporter.
 - 
            
        

 - 
        

CancelProfileIsBroken August 10th, 2009 @ 02:17 AM
- State changed from incomplete to invalid
 - Tag changed from actionpack, bugmash, collection_select, patch to actionpack, collection_select, patch
 
 
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>