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.

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

#3750

This ticket is invalid.

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

See https://webrat.lighthouseapp.com/projects/10503-webrat/tickets/345


For the record, the original text:

Hello,

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| [ p.name, p.id ] })

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 http://www.w3.org/TR/xhtml1/dtds.html#a_dtd_XHTML-1.0-Transitional .

The documentation specifically promises the same outcome I expect.

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

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

Activity

  1. Andreas Krüger
    Andreas Krüger

    Ooops...

    Let me quote the HTML:

    Exptected outcome:

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

    Outcome seen:

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

    January 19th, 2010 @ 06:37 PM

  2. Mike Riley
    Mike Riley
    • State changed from new to invalid
    • Importance changed from to Low

    Hello,

    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

    July 29th, 2010 @ 03:59 PM