I. Create a Middleman project with middleman-ember-template
$ middleman init hello --template=ember
II. Install ember.js package
$ bower install ember
require 'rubygems' | |
require 'nokogiri' | |
require 'eeepub' | |
DOC_TITLE = 'Ruby on Rails Guides' | |
def get_pages(src_dir) | |
index_file = File.join(src_dir, 'index.html') | |
section = nil | |
pages = [{ :section => section, :title => DOC_TITLE, :path => index_file }] |
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
I. Create a Middleman project with middleman-ember-template
$ middleman init hello --template=ember
II. Install ember.js package
$ bower install ember
Add transitions
hash to Ember.Route
, which contains transition handlers for preventing/redirecting/decorating attempted transitions, whether initiated by transitionTo
or URL change (handleURL
).
Dependency injection and service lookup are two important framework concepts. The first, dependency injection, refers a dependent object being injected onto another object during instantiation. For example, all route objects have the property router
set on them during instantiation. We say that the dependency of the router has been injected onto the route objects.
App.IndexRoute = Ember.Route.extend({
actions: {
showPath: function(){
// Dependency injection provides the router object to our
// route instance.
# Predictable SSH authentication socket location. | |
SOCK="/tmp/ssh-agent-$USER-screen" | |
if test $SSH_AUTH_SOCK && [ $SSH_AUTH_SOCK != $SOCK ] | |
then | |
rm -f $SOCK | |
ln -sf $SSH_AUTH_SOCK $SOCK | |
export SSH_AUTH_SOCK=$SOCK | |
fi |