README.md in handlebars_assets-0.11.0 vs README.md in handlebars_assets-0.12.0
- old
+ new
@@ -87,11 +87,11 @@
## 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
-```javascripts
+```javascript
//= require_tree ./templates
```
## The template file
@@ -172,9 +172,20 @@
Occasionally you might need to use a version of `handlebars.js` other than the included version. You can set the `compiler_path` and `compiler` options to use a custom version of `handlebars.js`.
```ruby
HandlebarsAssets::Config.compiler = 'my_handlebars.js' # Change the name of the compiler file
HandlebarsAssets::Config.compiler_path = Rails.root.join('app/assets/javascripts') # Change the location of the compiler file
+```
+
+## Patching `handlebars.js`
+
+If you need specific customizations to the `handlebars.js` compiler, you can use patch the compiler with your own JavaScript patches.
+
+The patch file(s) are concatenated with the `handlebars.js` file before compiling. Take a look at the test for details.
+
+```ruby
+HandlebarsAssets::Config.patch_files = 'my_patch.js'
+HandlebarsAssets::Config.patch_path = Rails.root.join('app/assets/javascripts') # Defaults to `Config.compiler_path`
```
# Thanks
This gem is standing on the shoulders of giants.