JST style templates for walrus via Sprockets
Ruby
Switch branches/tags
Nothing to show
Permalink
Failed to load latest commit information.
lib
.gitignore
Gemfile
README.md
Rakefile
walrus-rails.gemspec

README.md

walrus-rails

JST style templates with walrus.js via Sprockets

Summary

Write files named app/assets/javascripts/templates/tmpl.js.wal and use them client-side like this:

window.walrus_templates["templates/tmpl"](obj)

Installation

Add walrus-rails to your Gemfile

gem "walrus-rails"

This will register a new template engine in Sprockets to handle .wal files

Make sure to include your templates in your main application.js, for example:

//= require_tree ./templates

You'll also need walrus.js

That's it!

Configuration

You can change the namespace walrus_templates if you like:

# In some initialization code
Sprockets::WalrusTemplate.namespace = 'this.JST'