This project is archived and is in readonly mode.

#2277 ✓resolved
James B. Byrne

Rails 2.3.2 css#id namespace collision

Reported by James B. Byrne | March 17th, 2009 @ 07:58 PM | in 2.x

If a template, or nested templates, has both a call to content_tag_for Xobject and a call to form_for Xobject then these will both set the default css#id to xobject_(xobject.id) or to id="new_xobject". This violates the xhtml rule relating to id which state that an id must be unique in a single page.

This can be worked around by specifying an id prefix in either or both of: content_tag_for and form_for but it seems that the default behaviour should be such as to avoid such collisions.

My suggestion is that the default behaviour, at least for form_for which is likely the more important element for css purposes, be extended to include a method identifier in the id. In that case form_for Xobject might produce id="new_xobject_form" or id="xobject_idvalue_form".

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>

People watching this ticket

Pages