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.

Rails 2.3.2 css#id namespace collision

#2277

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".

Reported by James B. Byrne · March 17th, 2009 @ 07:58 PM

State: resolved
Milestone: 2.x
Assigned to: nobody
Importance: none

Activity

  1. Ryan Bigg
    Ryan Bigg
    • State changed from new to resolved

    This is the observed behaviour in 2.3.5 and 3.0.

    April 29th, 2010 @ 10:27 PM