0.01
No commit activity in last 3 years
No release in over 3 years
Ember for Middleman
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Ember::Middleman

Build Status Bitdeli Badge

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.

Installation

Add this line to your application's Gemfile:

gem 'ember-middleman'
gem 'ember-source' # You can specify the version you want to use

Execute:

$ bundle

Or install it yourself as:

$ gem install ember-middleman

And insert the following line to your config.rb:

activate :ember

Features

When you installed ember-middleman, the following features help you.

Path to libraries

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-data

HTMLBars precompilation

You can use HTMLBars as your template language for Ember.js.

$ mkdir -p source/javascripts/templates

And put your template.

For example:

  • source/javascripts/templates/ok-button.js.hbs
<div>
  <button {{action "someAction"}}>OK</button>
</div>

It automatically set as Ember.TEMPLATES['ok-button'].

Without precompilation, ember-template-compiler.js is required for client side compilation.

Generator

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=ember

Tests

bundle exec rake

Use Handlebars (using Ember.js < 1.10)

When you use Ember.js < 1.10, handlebars is required in your application.js.

//= require handlebars

Example Repository