Skip to content

Instantly share code, notes, and snippets.

@vast
Last active Aug 29, 2015
Embed
What would you like to do?
IE8 and Foundation 5 support
<!doctype html>
<html>
<head>
<!-- … -->
<!--[if gt IE 8]><!-->
<%= stylesheet_link_tag "application" %>
<!--<![endif]-->
<!--[if lt IE 9]>
<%= direct_stylesheet_link_tag "application" %>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<%= yield %>
</body>
</html>
module AssetHelper
def direct_stylesheet_link_tag(*sources)
captured = stylesheet_link_tag(*sources)
captured.to_str.gsub(/href="([^"]+)"/) do
path = URI(Regexp.last_match[1]).path
%(href="#{path}")
end.html_safe
end
end
source 'https://rubygems.org'
gem 'rails', '4.1.5'
# ...
gem 'rails-pixrem', github: 'vast/rails-pixrem'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment