Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Ruby Bindings for Handlebars.js
Ruby
branch: master

This branch is 2 commits ahead, 72 commits behind cowboyd:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
js @ 45c961a
lib
spec
.gitignore
.gitmodules
.rspec
Gemfile
Gemfile.lock
README.mdown
Rakefile
handlebars.gemspec

README.mdown

Handlebars.rb

This uses therubyracer to bind to the actual JavaScript implementation of Handlebars.js so that you can use it from ruby.

Hack

git clone git@github.com:cowboyd/handlebars.rb.git #git it
cd handlebars.rb #go to it
git submodule update --init #pull down handlebars.js
rspec spec/ #test it

Use

require 'handlebars'
template = Handlebars.compile("{{say}}{{what}}")
template.call(:say => "Hey", :what => "Yuh!") #=> "Hey Yuh!"
Something went wrong with that request. Please try again.