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.

:selected option is ignored for collection_select

#1037

(Copied from #7043 in old bug tracker)

The :selected option in collection_select is ignored. This patch uses the value of :selected option if it is provided, otherwise normal Rails behaviour apply.

Test included.

Reported by YoNoSoyTu · September 12th, 2008 @ 11:07 PM

State: resolved
Milestone: none
Assigned to: Pratik Pratik
Importance: none

Activity

  1. billno
    billno

    This patch is two years old!!! See #7043 in the old bug tracker

    What does it take to get it committed? I just checked github and it does not seem to be in the sources.

    This stuff up wasted a lot of my time. collection_select does NOT work as documented and this patch fixes it.

    September 30th, 2008 @ 03:41 AM

  2. Matt Buck
    Matt Buck

    I second that. What needs to be done to get this into core? I'm volunteering.

    October 23rd, 2008 @ 09:02 PM

  3. YoNoSoyTu
    YoNoSoyTu

    Read http://rails.lighthouseapp.com/p...

    You only have to apply the patch to the Rails edge, test it and if it works give this ticket a comment with "plus 1" (with the symbol and without the space), and a short comment why this patch should be considered for inclusion.

    By the way, I have updated the patch, removing whitespace, as source style document say.

    October 23rd, 2008 @ 09:28 PM

  4. YoNoSoyTu
    YoNoSoyTu

    I did not know who to merge both patches into one (sorry).

    October 23rd, 2008 @ 09:29 PM

  5. Gabriel Medina
    Gabriel Medina
    • Title changed from :selected option is ignored for collection_select to [PATCH] :selected option is ignored for collection_select
    • Tag changed from actionpack, bug, edge, helper, patch, tested, tiny to actionpack, bug, collection, collection_select, edge, helper, ignored, patch, selected, tested, tiny

    Single file patch.

    Gabriel Medina.

    October 31st, 2008 @ 11:05 AM

  6. Shane Vitarana
    Shane Vitarana

    +1, works as expected and tests look good.

    November 3rd, 2008 @ 05:02 AM

  7. Pratik
    Pratik
    • Milestone cleared.
    • Assigned user set to Pratik
    • Title changed from [PATCH] :selected option is ignored for collection_select to :selected option is ignored for collection_select

    January 19th, 2009 @ 08:15 PM

  8. Repository
    Repository
    • State changed from new to resolved

    (from [9a8e2a059c823498e0fb318f25b926a6d015ef87]) Ensure selected option is not ignored for collection_select. [#1037 :selected option is ignored for collection_select state:resolved]

    Signed-off-by: Pratik Naik pratiknaik@gmail.com http://github.com/rails/rails/co...

    January 28th, 2009 @ 08:01 PM

  9. bingbing