README.md in handlebars_assets-0.7.0 vs README.md in handlebars_assets-0.7.1
- old
+ new
@@ -6,12 +6,14 @@
Using `sprockets` with Sinatra or another framework? **handlebars_assets** works outside of Rails too (as of v0.2.0)
## handlebars.js
-`handlebars_assets` is packaged with `v1.0.rc.1` of `handlebars.js`.
+**Please read**
+Because of a serious regression introduced in RC1, `handlebars_assets` is packaged with an edge build of `handlebars.js` (this [commit](https://github.com/wycats/handlebars.js/commit/bd0490145438e8f9df05abd2f4c25687bac81326). See the section on using another version if that does not work for you.
+
## Installation with Rails 3.1+
Load `handlebars_assets` in your `Gemfile` as part of the `assets` group
group :assets do
@@ -46,14 +48,26 @@
//= require handlebars
## 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:
+`handlebars_assets` also works when you are precompiling your assets.
+### Heroku
+
+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
+This avoids running your initializers when compiling assets (see the [guide](http://guides.rubyonrails.org/asset_pipeline.html#precompiling-assets) for why you would want that).
+
+However, that does mean that you cannot set your configuration in an initializer. This [issue](https://github.com/leshill/handlebars_assets/issues/34) has a workaround, or you can set:
+
+ config.assets.initialize_on_precompile = true
+
+This will run all your initializers before precompiling assets.
+
## Templates directory
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
@@ -96,15 +110,13 @@
For example, if you have a file `widget.hamlbars` that looks like this:
%h1 {{title}}
%p {{body}}
-Haml will first convert it to:
+The Haml will be pre-processed so that the Handlebars template is basically this:
<h1> {{title}} </h1>
<p> {{body}} </p>
-
-And the Handlebars will turn it into a JavaScript template.
## 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: