Created
November 20, 2013 06:21
-
-
Save sj26/7558617 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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