Handlebars.js for Rails 3.1
Add the gem to your application Gemfile:
gem 'handlebars-rails', :git => 'git://github.com/kolo/handlebars-rails.git'
bundle install and add folowing lines to
//= require handlebars-rails //= require handlebars
Now you can create hadlebars template files by putting each template in
dedicated '.js.hjs' file (e.g.
//= require_tree .
Now you can add this file in
application.js or load it in the layout.
be available as TEMPLATES.templates_posts_index function.
This gem was insired by sproutcore-rails and I used code from that gem.