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.

[PATCH] Allow disabling of self-closing tags generation TagHelper#tag

#1565

Helpers like stylesheet_link_tag cannot be used when using a DOCTYPE of HTML 4.01 Transitional (e.g. if you're using iFrame remoting). This patch provides a way to globally turn off self-closing tags:

ActionView::Helpers::TagHelper.generate_self_closing_tags = false

And also allows the option to be set on a case-by-case basis:

stylesheet_link_tag :screen, :open => true

Reported by Nathan de Vries · December 12th, 2008 @ 06:42 AM

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

Activity

  1. Frederick Cheung
    Frederick Cheung

    I'm not going to comment on the usefullness of such a patch, but at the very least it needs tests.

    December 12th, 2008 @ 07:38 AM

  2. Andrew White
    Andrew White

    Save yourself sometime and read this thread:

    http://groups.google.com/group/r...

    Then go and do something more productive with your time.

    If you still really want HTML4 output from rails then you'll need to write a plugin which patches tag and also the handful of places in Rails that hardcode self closing tags, e.g: simple_format.

    December 13th, 2008 @ 03:48 AM

  3. Nathan de Vries
    Nathan de Vries

    @Andrew White: How infuriating. Thanks for pointing me to your ticket and saving me some time. Kind of disappointing to see people referring to HTML 4.01 as "retarded", and being backed up by Rails-core guys. It's the equivalent of arguing that "foo unless bar" is somehow wrong because it's not enclosed in an "unless"/"end" statement.

    I could have sworn the majority of the web development community had realised their overzealousness when it came to XHTML. Pity that's not the case.

    December 14th, 2008 @ 04:16 AM

  4. Frederick Cheung
    Frederick Cheung
    • State changed from new to wontfix

    Seems like this is one to leave for now.

    December 14th, 2008 @ 10:32 AM