README.md in handlebars_assets-0.1.4 vs README.md in handlebars_assets-0.2.0

- old
+ new

@@ -1,31 +1,33 @@ -# Use handlebars.js templates with the asset pipeline +# Use handlebars.js templates with the asset pipeline and sprockets **ALPHA** Are your `handlebars.js` templates littering your Rails views with `script` tags? Wondering why the nifty Rails 3.1 asset pipeline streamlines all your Javascript except for your Handlebars templates? Wouldn't it be nice to have your Handlebars templates compiled, compressed, and cached like your other Javascript? Yea, I think so too. That is why I wrote **handlebars_assets**. Give your Handlebars templates their own files (including partials) and have them compiled, compressed, and cached as part of the Rails 3.1 asset pipeline! +Using `sprockets` with Sinatra or another framework? **handlebars_assets** works outside of Rails too (as of v0.2.0) + ## Installation Load `handlebars_assets` in your `Gemfile` as part of the `assets` group group :assets do gem 'handlebars_assets' end +# Compiling your Javascript templates in the Rails asset pipeline + Require `handlebars.vm.js` in your Javascript manifest (i.e. `application.js`) //= require handlebars.vm If you need to compile your Javascript templates in the browser as well, you should instead require `handlebars.js` (which is significantly larger) //= require handlebars -# Compiling your Javascript templates in the asset pipeline - ## Precompiling `handlebars_assets` also works when you are precompiling your assets. If you are deploying to Heroku, be sure to read the [Rails guide](http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets) and in your `config/application.rb` set: config.assets.initialize_on_precompile = false @@ -71,10 +73,12 @@ contacts/ _form.hbs todos/ _form.hbs +## TODO document Sinatra setup + # Thanks This gem is standing on the shoulders of giants. Thank you Yehuda Katz (@wycats) for [handlebars.js](https://github.com/wycats/handlebars.js) and lots of other code I use every day. @@ -98,5 +102,6 @@ # Contributors * Matt Burke (@spraints) : execjs support * (@kendagriff) : 1.8.7 compatibility * Thorben Schröder (@walski) : 3.1 asset group for precompile +* Erwan Barrier (@erwanb) : Support for plain sprockets