Gem 包装器,可通过 Rails 3.1 资产管道包含 Modernizr.js 库。
The modernizr-rails gem will include the Modernizr.js library into your Rails 3.1+ app via the asset pipeline. This gem is bundled with the last tagged release version from the Modernizr GitHub repo, which is minified by the Rails Assets Pipeline for you automatically. If you need custom feature detection tests, consider the Custom feature detection tests section in this README.
Add the following to your assets group in your Gemfile:
group :assets do
gem 'modernizr-rails'
endAdd the following into your Gemfile:
gem 'modernizr-rails'Modernizr should be added to the of your HTML. Be sure to check out the [offical docs](http://modernizr.com/docs/#installing) about **Installing Modernizr** for more info. Include it using the helper like so, Rails will take care of the compilation and minification automatically for you.
Example of your app/views/layouts/application.html.erb:
Your Awesome App
...
If you need a custom feature detection test not included in the Modernizr build shipped with this gem, please consider using your own version instead of sending a pull request to include your test. You can easily do this by moving your Modernizr build in to one of the assets folder. Rails will automagically use your build instead of the shipped one. However you can still continue to use this gem and its features (like the precompile hook, and so on).
modernizr.custom.12345.js to just modernizr.js.vendor/assets/javascripts.git checkout -b my-new-feature)git commit -am 'Added some feature')git push origin my-new-feature)(The MIT license)
Copyright (C) 2011-2013 Russell Frisch (russfrisch)
See LICENSE.md.
暂无开放 Issues,或尚未同步最近议题。