Ruby HAML-JS
Precompiles the HAML-JS templates into a function.
This can be used as a standalone template or as part of Rails 3.1 assets pipeline.
Installation - Rails 3.1
# Gemfile
gem 'ruby-haml-js'
# Then install it
bundle
Usage - with Rails 3.1 assets pipeline
- Put your template unders
app/assets/javascripts
(or other path where Rails can find it). - Use the naming
my-template.jst.hamljs
. - Serve the template to browser by
require my-template
fromapplication.js
or link to it asmy-template.js
- Use the template from the JavaScript:
JST['my-template']({your: 'local', variables: 'go here'})
Development
- Source hosted at GitHub
- Report issues and feature requests to GitHub Issues
Pull requests are very welcome! But please write the specs.
To start, clone the repo and then:
bundle install
bundle exec rspec spec/