Sha256: 9ad55b34a292783fea0f2d60a3d61ca7a55f02d745e379202c96f8940c681314

Contents?: true

Size: 1.33 KB

Versions: 11

Compression:

Stored size: 1.33 KB

Contents

h1. Webshims-rails

Easily include the "webshims library":http://aFarkas.github.com/webshim/demos/index.html (by Alexander Farkas) in your Rails 3.1+ project with the asset pipeline.

h2. Usage

1. Add webshims-rails to your Gemfile for bundler: @gem 'webshims-rails'@
2. Require modernizr and the webshims polyfiller, eg, in your application.js:

<pre>
//= require webshims/extras/modernizr-custom
//= require webshims/polyfiller
</pre>

*Update note:* Previous webshims-rails included only the minified versions; this was incorrect, since the dev (unminified) versions should be required by Sprockets and then the Rails asset pipeline will minify as necessary in production. The unminified ('dev') versions have been moved up a directory to simplify the require paths.

Users of previous webshims-rails versions should update their sprockets requires and webshims options as below (though I'll leave the minified assets in there to prevent errors).

3. In your javascript, after the polyfiller has been required, set the basePath for webshims as shown below, and then call $.webshims.polyfill(); see webshims docs for more options.
(Note that this should be run directly, not in a dom-ready block.)

<pre>
  $.webshims.setOptions('basePath', '/assets/webshims/shims/')
  $.webshims.polyfill()
</pre>


h2. License

MIT licensed, like the Webshims library.

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
webshims-rails-1.10.11 readme.textile
webshims-rails-1.10.10 readme.textile
webshims-rails-1.10.9 readme.textile
webshims-rails-1.10.6 readme.textile
webshims-rails-1.10.3 readme.textile
webshims-rails-0.4.7 readme.textile
webshims-rails-0.4.6 readme.textile
webshims-rails-0.4.5 readme.textile
webshims-rails-0.4.4 readme.textile
webshims-rails-0.4.3 readme.textile
webshims-rails-0.4.2 readme.textile