This project is archived and is in readonly mode.

#3483 ✓stale
Josh Sharpe

FormHelper#label :id => nil doesn't nullify the id attribute

Reported by Josh Sharpe | November 12th, 2009 @ 05:59 AM

For at least #label and #text_field (my guess is the rest of the helpers) passing :id => nil as an option does not prevent the ID attribute from showing up on the tag.

If we can agree this is a bug then I believe the offending line is in:

FormHelper#add_default_name_and_id

http://github.com/rails/rails/blob/e972acc0d7b63e5ce15bed69f41214fe...

This does work as expected for label_tag and text_field_tag. It'd probably be good if they both worked the same way in this regard.

Comments and changes to this ticket

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>

Pages