Skip to content

Instantly share code, notes, and snippets.

@sj26
Created November 20, 2013 06:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sj26/7558617 to your computer and use it in GitHub Desktop.
Save sj26/7558617 to your computer and use it in GitHub Desktop.
doctype html
= html_tag_with_ie_version lang: "en", class: ["no-js", "wf-loading"], "xmlns:ng" => "http://angularjs.org" do
head
title Some site that has to deal with IE crap
body
p What an example!
module HtmlTagHelper
def html_tag_with_ie_version options, &block
raw("<!--[if lt IE 7 ]>") << tag(:html, options.deep_merge(class: "ie6")) << raw("<![endif]-->") <<
raw("<!--[if IE 7 ]>") << tag(:html, options.deep_merge(class: "ie7")) << "<![endif]-->" <<
raw("<!--[if IE 8 ]>") << tag(:html, options.deep_merge(class: "ie8")) << "<![endif]-->" <<
raw("<!--[if IE 9 ]>") << tag(:html, options.deep_merge(class: "ie9")) << "<![endif]-->" <<
raw("<!--[if (gt IE 9)|!(IE)]-->") <<
tag("html", options, &block) <<
raw("<!--[endif]-->") <<
capture(&block) <<
raw("</html>")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment