Skip to content

Instantly share code, notes, and snippets.

@mrdanadams
Created May 2, 2013 13: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 mrdanadams/5502042 to your computer and use it in GitHub Desktop.
Save mrdanadams/5502042 to your computer and use it in GitHub Desktop.
Conditionally loading jQuery / Zepto.js in Rails 3
#= require jquery
#= require application.js
#= require ../../../vendor/assets/javascripts/zepto.min.js
#= require application.js
# normal application js included in both IE and other browsers
<!-- application layout -->
<!-- include this at the bottom of the head or body -->
<script>
document.write('<script src="' +
('__proto__' in {} ? '<%= path_to_asset("application-zepto.js") %>' : '<%= path_to_asset("application-ie.js") %>') +
'"><\/script>');
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment