In Ember, the application's state manager handles routing. Let's take a look at a simple example:
App.stateManager = Ember.StateManager.create({
start: Ember.State.extend({
index: Ember.State.extend({
route "/",
# Monkey Patch ruby because of a bug introduced in ruby versions greater than 1.9.2 | |
# For some reason the exit code is all wrong in later version of ruby and even though | |
# the issue was closed as sorted it's still broken in ruby version 1.9.3-p194. | |
# (see http://redmine.ruby-lang.org/issues/5218 for more information) | |
# Put this in spec_helper.rb or test_helper.rb so that it only affects specs and the CI server. | |
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" && RUBY_VERSION >= "1.9" | |
module Kernel | |
alias :__at_exit :at_exit | |
def at_exit(&block) | |
__at_exit do |
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>*</AllowedHeader> | |
</CORSRule> | |
</CORSConfiguration> |
class Node | |
attr_accessor :data, :left, :right | |
def initialize(*args) | |
@data,@left,@right = args | |
end | |
end | |
class Tree | |
attr_accessor :root |
window.ChangeQuantity ||= {} | |
ChangeQuantity.load = ()-> | |
$("input.change-quantity").click((evnt)-> | |
evnt.preventDefault() | |
quantityField = $(this).parent().find('input.quantity') | |
currVal = parseInt(quantityField.val()) |
# Git branch in prompt. | |
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
export PS1="\u@\h \W\[\033[32m\]\$(parse_git_branch)\[\033[00m\] $ " | |
source ~/.profile |
<?xml version="1.0" encoding="utf-8"?> | |
<?qbxml version="13.0"?> | |
<QBXML> | |
<QBXMLMsgsRq onError="stopOnError"> | |
<SalesReceiptAddRq> | |
<SalesReceiptAdd defMacro="MACROTYPE"> <!-- required --> | |
<CustomerRef> <!-- optional --> | |
<ListID >IDTYPE</ListID> <!-- optional --> | |
<FullName >STRTYPE</FullName> <!-- optional --> | |
</CustomerRef> |
{ | |
"Results": [ | |
{ | |
"Id": 550518851, | |
"Name": "Tri-Band Ballpoint Pen", | |
"Description": "Tri-band ballpoint pen with silver trim and black rubber grip for writing comfort and control. These tri-band ballpoint pens include plunger action. These tri-band ballpoint pens are also available in a variety of new colors! Tri-band ballpoint pens are a great giveaway for any event or trade show. Ensure your clients remember you and write away the competition with these great ballpoint pens!", | |
"Number": "AZ898", | |
"ImageUrl": "media/22117985", | |
"VirtualSampleImages": [ | |
{ |
{ | |
"Id": 550518851, | |
"Name": "Tri-Band Ballpoint Pen", | |
"Description": "Tri-band ballpoint pen with silver trim and black rubber grip for writing comfort and control. These tri-band ballpoint pens include plunger action. These tri-band ballpoint pens are also available in a variety of new colors! Tri-band ballpoint pens are a great giveaway for any event or trade show. Ensure your clients remember you and write away the competition with these great ballpoint pens!", | |
"ShortDescription": "Tri-band ballpoint pen with silver trim and black rubber grip. Rubber grip and silver trim on tri-band ballpoint pens.", | |
"Number": "AZ898", | |
"Numbers": [ | |
"AZ898" | |
], | |
"ImageUrl": "media/22117985", |
{"Id"=>550201890, | |
"Name"=>"Spear Glass Trophies", | |
"Description"=> | |
"Cut right to the heart of the matter when you acknowledge the accomplishments of your employees with these Spear Glass Trophies. These exquisite blue and clear awards have a 2.25\" x 3\" imprint area that you can customize using laser engraving or you can order them blank. The glass trophies measure 9\" H x 5.75\" W x 0.4\" thick and will be the envy of the office. They are perfect for your top sales people, employee of the month and any other special achievements in the company. Show your employees that you value everything they bring to the business!", | |
"ShortDescription"=>"Spear Glass Trophies", | |
"Number"=>"ADMAW16", | |
"Numbers"=>["ADMAW16"], | |
"ImageUrl"=>"media/20816194", | |
"VirtualSampleImages"=> | |
[{"Id"=>20816194, |