ember-middleman supports using Ember.js with Middleman in easily. You can use this with hamlbars if you like.
This gem is inspired by ember-rails.
Add this line to your application's Gemfile:
gem 'ember-middleman'
gem 'ember-source' # You can specify the version you want to useExecute:
$ bundleOr install it yourself as:
$ gem install ember-middlemanAnd insert the following line to your config.rb:
activate :emberWhen you installed ember-middleman, the following features help you.
You can use Ember.js and ember-data.
Please write the followings to your application.js (or something you use):
You should require jQuery before require ember.
//= require ember
//= require ember-dataYou can use HTMLBars as your template language for Ember.js.
$ mkdir -p source/javascripts/templatesAnd put your template.
For example:
source/javascripts/templates/ok-button.js.hbs
It automatically set as Ember.TEMPLATES['ok-button'].
Without precompilation, ember-template-compiler.js is required for client side compilation.
You can generate a fresh project already setup for ember:
# Gemfile
source 'https://rubygems.org'
gem 'middleman'
gem 'ember-middleman'$ bundle exec middleman init . --template=emberbundle exec rakeWhen you use Ember.js < 1.10, handlebars is required in your application.js.
//= require handlebars
