This project is archived and is in readonly mode.

#3750 ✓invalid
Andreas Krüger

FormOptionsHelper's select method produces old <option selected>, not XHTML <option selected="selected">

Reported by Andreas Krüger | January 19th, 2010 @ 06:34 PM

This ticket is invalid.

I was mislead by a badly-constructed Webrat error message.


For the record, the original text:


I'm using the select method of ActionView::Helpers::FormOptionsHelper
as suggested by the documentation:

Example with @post.person_id => 2:

select("post", "person_id", Person.all.collect {|p| [, ] })

I left out the {:include_blank => 'None'} part in the above quote and in my code.

Expected outcome:

<option value="2" selected="selected">Sam

Outcome seen:

<option value="2" selected>Sam

While this is accepted by many browsers, this isn't valid XHMTL.
Compare .

The documentation specifically promises the same outcome I expect.

Comments and changes to this ticket

  • Andreas Krüger

    Andreas Krüger January 19th, 2010 @ 06:37 PM


    Let me quote the HTML:

    Exptected outcome:

    <option value="2" selected="selected">Sam</option>

    Outcome seen:

    <option value="2" selected>Sam</option>

  • Mike Riley

    Mike Riley July 29th, 2010 @ 03:59 PM

    • State changed from “new” to “invalid”
    • Importance changed from “” to “Low”


    I see you mentioned that this ticket is invalid. I am going to go mark it as such. If this is incorrect, let us know so we can investigate further.

    Mike Riley

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=""></a>