Is there a way to request Rails helper functions not to generate XHTML but HTML?

I would like to use HTML 4.01 Strict and use the DOCTYPE of this in my application template. But look when the stylesheet is enabled by the helper function

<%= stylesheet_link_tag 'style' %>

      

the resulting code is XHTML:

<link href = "/stylesheets/style.css? 1243210734" media = "screen" rel = "stylesheet" type = "text / css" / ">

Is there a way to ask Rails to generate HTML instead of XHTML? (so the HTML will be validated for example)

+1


a source to share


2 answers


Just copy the above code that works.

module ActionView::Helpers::TagHelper
  def tag_with_html(name, options = nil, open = true, escape = true)
    tag_without_html(name, options, true, escape)
  end
  alias_method_chain :tag, :html
end

      



Thanks for the tip!

+3


a source


Not really, no.

Edit: as per my comment below, this should work (I still feel awkward, but I can't think of anything that would break because of this)



module ActionView::Helpers::TagHelper
  def tag_with_html(name, options = nil, open, escape = true)
    tag_without_html(name, options, true, escape)
  end
  alias_method_chain :tag, :html
end 

      

0


a source







All Articles