This project is archived and is in readonly mode.
radio_button can generate duplicate id attributes (invalid HTML)
Reported by Paul Schreiber | June 14th, 2010 @ 08:50 PM | in 3.0.2
Possibly related to #2937.
Sometimes, radio_button can generate duplicate id attributes.
Suppose you have this ERB:
<%= f.radio_button :winner_accepted, 1 %>
<%= f.radio_button :winner_accepted, -1 %>
You get this HTML:
<input id="nominee_winner_accepted_1" name="nominee[winner_accepted]" type="radio" value="1" />
<input id="nominee_winner_accepted_1" name="nominee[winner_accepted]" type="radio" value="-1" />
Comments and changes to this ticket
-
Rainer Blessing June 17th, 2010 @ 06:51 PM
Only word characters (letters, digits, and underscores) are used from the value attribute. The attached patch would also allow a minus character.
-
Rainer Blessing June 17th, 2010 @ 07:24 PM
- Tag set to patch
-
José Valim June 21st, 2010 @ 10:43 AM
- Milestone cleared.
- Assigned user set to José Valim
Rainer, good patch! Could you please include tests as well?
-
Repository June 22nd, 2010 @ 02:14 PM
- State changed from new to resolved
(from [70c932f794073812818a1bd6b9d7de422b5ef679]) adds minus to value part of id [#4862 state:resolved]
Signed-off-by: José Valim jose.valim@gmail.com
http://github.com/rails/rails/commit/70c932f794073812818a1bd6b9d7de...
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>
People watching this ticket
Attachments
Tags
Referenced by
- 4862 radio_button can generate duplicate id attributes (invalid HTML) (from [70c932f794073812818a1bd6b9d7de422b5ef679]) adds mi...