This project is archived and is in readonly mode.
text_area_tag sanitize_to_id
Reported by sanderson (at nexttesting) | January 6th, 2009 @ 05:45 PM | in 2.x
text_area_tag('item[description]') should set id to "item_description" instead of "item[description]".
The unsanitized id with brackets fails HTML validation.
This is fixed by the attached simple patch file, which sets id to sanitize_to_id(name), instead of just name.
Test included.
Comments and changes to this ticket
-
Matt Jones January 7th, 2009 @ 03:10 AM
- Tag changed from html, sanitize_to_id, validation to html, patch, sanitize_to_id, validation
+1 - looks reasonable to me. Matches existing behavior and tests for other *_tag helpers.
-
Angel N. Sciortino (angelic) January 8th, 2009 @ 03:26 PM
It makes sense to me, and the test looks good.
-
Tim Cartwright January 8th, 2009 @ 03:50 PM
This bug bit me when validating generated forms using the W3C’s HTML markup validator. Having a bug like this causes lots of error messages, making it difficult to see if there are other, more critical HTML errors. Plus, Rails just ought to generate clean HTML, IMO.
-
Chris Mear February 20th, 2009 @ 03:41 PM
- Tag changed from html, patch, sanitize_to_id, validation to html, patch, sanitize_to_id, validation, verified
+1 Makes sense -- makes it consistent with other FormTagHelper methods, and test looks good.
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
Referenced by
- 1802 text_area_tag does not sanitize id value This appears to be a duplicate of #1703.
- 2496 missing sanitize_to_id in FormTagHelper#text_area_tag Duplicate of #1703.
- 2586 2.3.2 text_area_tag doesn't sanitize the id attribute Duplicate of #1703 (and #1802).