Forum: Ruby on Rails Rails and HTML 4.01 (not XHTML)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5974f50172fd161e3cccac40ecbe3934?d=identicon&s=25 hdante (Guest)
on 2007-06-10 01:29
(Received via mailing list)
Hi,

 I've tried to change my layouts to HTML 4.01 DOCTYPE, but then the
page didn't pass w3 validation. Validation fails in the line that
corresponds to the following:

   <%= stylesheet_link_tag "depot", :media => "all" %>

 This is rendered as

   <link href="/stylesheets/depot.css?1181336605" media="all"
rel="Stylesheet" type="text/css" />

 Change the final "/>" to ">" and the page is validated.

 Are you sure HTML 4.01 is allowed ? How can I make
stylesheet_link_tag and other constructs to correctly produce HTML
4.01 output ? It would be really nice if I fully converted my pages to
HTML 4.01.

 Any help ? Thanks,
Af72b502d277ea86637ba12c5056ec68?d=identicon&s=25 unknown (Guest)
on 2008-04-17 06:08
(Received via mailing list)
calling back an old one - perhaps better than starting a new thread for
an
unfinished topic though.
so how does one successfully use a HTML 4.01 strict DOCTYPE with rails
helpers and hope to validate? i added the following to my
application_helper
file which seems to do the trick for stylesheets but this is trying a
symptom

  def other_stylesheet_link_tag(*sources)
    out = stylesheet_link_tag sources
    out.sub(/\ \/\>$/, '>')
  end

stylesheet_link_tag calls stylesheet_tag which calls tag

tag has an open argument to leave tags open, but unfortunately there
isn't
any way to access it from stylesheet_link_tag. any other suggestions?
  <
http://api.rubyonrails.org/classes/ActionView/Help...
>

cheers,
jean-pierre
059ed46172a087063ce26250e44c8627?d=identicon&s=25 Fernando Perez (fernando)
on 2008-09-22 15:39
Too funny that I just figured out the same thing. Why is Rails
generating this additional character?
This topic is locked and can not be replied to.