Sha256: 63bc472cb1ab2a7a7f0fa2d9158c0061efe538d22962d268d3683c86c6347782
Contents?: true
Size: 1.57 KB
Versions: 1
Compression:
Stored size: 1.57 KB
Contents
## Haml JavaScript (JST) Templates for Rails Lets you use https://github.com/uglyog/clientside-haml-js templates in the Rails asset pipeline. No need to download haml.js, this gem includes the haml.js file for you. * Requires ExecJS * Requires CoffeeScript ## Why another Haml in JavaScript gem? Uglyog's library lets you use coffeescript, which allows the embedded JavaScript in your Haml templates to be much more beautiful and Ruby-like. While I'm not the biggest fan of coffeescript for actual javascript coding, it's the perfect solution for haml templates. The other gems use creationix's library. The gem hooks in to the asset pipeline to give you precompiled haml templates which are actually blazing fast for the user and should be perfectly compatible with production environments. ## Installation Add this line to your `Gemfile` gem 'rails-hamljs', :git => 'git://github.com/rocksolidwebdesign/rails-hamljs' ## Usage Simply add JST templates with an extension of `.haml` to your javascript templates directory app/assets/javascripts/templates/foo.jst.haml And of course, be sure to //= require_tree ./templates in the correct order so that the global `JST` variable is available. Then, as with other JST templates such as ECO and EJS, you may access your templates from the `JST` object: var template = JST["templates/foo"]; var htmlOutput = template({ someVar: "someValue", someOtherVar: "someOtherVal" }); ## TODO Configuration: Toggle whose library to use (creationix or uglyog) Toggle coffeescript (if using uglyog's library)
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails-hamljs-0.0.1 | README.md |