README.md in handlebars_assets-0.4.4 vs README.md in handlebars_assets-0.5.0
- old
+ new
@@ -1,9 +1,5 @@
-# BREAKING CHANGE
-
-`handlebars.vm.js` was renamed to `handlebars.runtime.js`, please update your Javascript manifest.
-
# Use handlebars.js templates with the asset pipeline and sprockets
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!
@@ -56,13 +52,13 @@
config.assets.initialize_on_precompile = false
## Templates directory
-You should locate your templates with your other assets, for example `app/assets/templates`. In your Javascript manifest file, use `require_tree` to pull in the templates
+You should locate your templates with your other assets, for example `app/assets/javascripts/templates`. In your Javascript manifest file, use `require_tree` to pull in the templates
- //= require_tree ../templates
+ //= require_tree ./templates
## The template file
Write your Handlebars templates as standalone files in your templates directory. Organize the templates similarly to Rails views.
@@ -72,30 +68,21 @@
contacts/
new.hbs
edit.hbs
show.hbs
-Your file extensions tell the asset pipeline how to process the file. Use `.hbs` to compile the template with Handlebars. Combine it with `.jst` to add the compiled template to the `JST` global variable.
+Your file extensions tell the asset pipeline how to process the file. Use `.hbs` to compile the template with Handlebars.
If your file is `templates/contacts/new.hbs`, the asset pipeline will generate Javascript code
1. Compile the Handlebars template to Javascript code
1. Add the template code to the `HandlebarsTemplates` global under the name `contacts/new`
You can then invoke the resulting template in your application's Javascript
HandlebarsTemplates['contacts/new'](context);
-## JST
-
-`sprockets` ships with a simple JavaScript template wrapper called `JST` for
-use with the `ejs` and other gems.
-
-`handlebars_assets` is compatible with `JST`. If you name your template files
-`name.jst.hbs`, you will have access to your templates through the `JST` global
-just like your `ejs` templates.
-
## Partials
If you begin the name of the template with an underscore, it will be recognized as a partial. You can invoke partials inside a template using the Handlebars partial syntax:
Invoke a {{> partial }}
@@ -114,28 +101,32 @@
Thank you Yehuda Katz (@wycats) for [handlebars.js](https://github.com/wycats/handlebars.js) and lots of other code I use every day.
Thank you Charles Lowell (@cowboyd) for [therubyracer](https://github.com/cowboyd/therubyracer) and [handlebars.rb](https://github.com/cowboyd/handlebars.rb).
-# Contributing
+# Author
-Once you've made your great commits
+Hi, I'm Les Hill and I make things go.
-1. Fork
-1. Create a topic branch - git checkout -b my_branch
-1. Push to your branch - git push origin my_branch
-1. Create a Pull Request from your branch
-1. That's it!
+Follow me on [Github](https://github.com/leshill) and [Twitter](https://twitter.com/leshill).
-# Author
-* Les Hill (@leshill)
-
# 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
* Brendan Loudermilk (@bloudermilk) : HandlebarsAssets.path
* Dan Evans (@danevans) : Rails 2 support
* Ben Woosley (@empact) : Update to handlebars.js 1.0.0.beta.6
+* (@cw-moshe) : Remove 'templates/' from names
+
+# Contributing
+
+Once you've made your great commits
+
+1. Fork
+1. Create a topic branch - git checkout -b my_branch
+1. Push to your branch - git push origin my_branch
+1. Create a Pull Request from your branch
+1. That's it!