Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

[PATCH] collection_select not displaying :prompt when value present

#147

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)

Reported by Andrew Selder · May 8th, 2008 @ 08:03 PM

State: invalid
Milestone: none
Assigned to: nobody
Importance: none

Activity

  1. Pratik
    Pratik
    • Title changed from [PATCH] collection_select not displaying :prompt when value present to collection_select not displaying :prompt when value present

    May 13th, 2008 @ 02:14 PM

  2. Pratik
    Pratik
    • State changed from new to incomplete

    The uploaded patch seems garbled. Could you please upload a new patch ?

    Thanks.

    May 13th, 2008 @ 02:25 PM

  3. Andrew Selder
    Andrew Selder

    Attached a new copy of the patch. This one should work.

    May 13th, 2008 @ 02:32 PM

  4. Andrew Selder
    Andrew Selder
    • 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

    August 12th, 2008 @ 09:29 PM

  5. CancelProfileIsBroken
    CancelProfileIsBroken
    • Tag changed from actionpack, collection_select, patch to actionpack, bugmash, collection_select, patch

    August 3rd, 2009 @ 03:03 PM

  6. Cristi Balan
    Cristi Balan

    -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.

    August 8th, 2009 @ 04:24 PM

  7. Peer Allan
    Peer Allan

    -1 for the same reason identified by Cristi Balan

    August 10th, 2009 @ 02:15 AM

  8. CancelProfileIsBroken
    CancelProfileIsBroken
    • State changed from incomplete to invalid
    • Tag changed from actionpack, bugmash, collection_select, patch to actionpack, collection_select, patch

    August 10th, 2009 @ 02:17 AM