Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blakewilliams/backbone_handlebars
Backbone + Handlebars for Rails with template precompilation
https://github.com/blakewilliams/backbone_handlebars
Last synced: 2 months ago
JSON representation
Backbone + Handlebars for Rails with template precompilation
- Host: GitHub
- URL: https://github.com/blakewilliams/backbone_handlebars
- Owner: BlakeWilliams
- License: mit
- Created: 2013-01-19T04:20:17.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-01-19T22:56:13.000Z (almost 12 years ago)
- Last Synced: 2024-10-20T05:58:12.901Z (3 months ago)
- Language: Ruby
- Size: 168 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# BackboneHandlebars
A gem that vendors the latest Backbone, Underscore, and Handlebars libraries and compiles/precompiles Handlebars templates.
## Installation
Add this line to your application's Gemfile:
```ruby
gem 'backbone_handlebars'
```## Usage
rails generate backbone_handlebars:install
This will generate the applications structure in the app/assets/javascripts directory and add the precompile option to your production environment.
Your templates will be stored in `Handlebars.templates` and can be accessed by their path + name. eg: You have a template called post.handlebars in `app/assets/javascripts/templates/posts/post.handlebars`. You would access this template with the following:
```javascript
Handlebars.templates['posts/post']
```
## Options```ruby
config.handlebars.precompile
```Enables precompilation and will serve only the Handlebars runtime instead of the full library.
```
config.handlebars.path
```Changes the path of the Handlebars library that precompiles your templates
If you want to use your own Handlebars or Handlebars runtime place them in `vendor/assets/handlebars/development` and `vendor/assets/handlebars/production` respectively.