Skip to content

Instantly share code, notes, and snippets.

@vast
Last active August 29, 2015 14:05
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 vast/bbeea16b50aee1c1715f to your computer and use it in GitHub Desktop.
Save vast/bbeea16b50aee1c1715f to your computer and use it in GitHub Desktop.
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