Skip to content

Instantly share code, notes, and snippets.

@rpocklin
Last active December 26, 2015 07:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rpocklin/7114606 to your computer and use it in GitHub Desktop.
Save rpocklin/7114606 to your computer and use it in GitHub Desktop.
Get emblem-rails working on any Rails 3.1+ app without ember.js handlebars.js is required
// add gem 'emblem-rails' to your Rails Gemfile and run 'bundle'
// create your template file in your Rails project
/app/assets/javascripts/templates/test.raw.emblem eg. 'h1 {{title}} world'
// add the following to your Rails application.js
Ember = {TEMPLATES: [], Handlebars: Handlebars}
//= require_tree ./templates
// anywhere later in your code - call it as a compiled template:
$('body').html(Ember.TEMPLATES['test']({title: 'hello'}));
// beer ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment