Skip to content

Instantly share code, notes, and snippets.

@juggy
Created March 6, 2012 21:43
Show Gist options
  • Save juggy/1989122 to your computer and use it in GitHub Desktop.
Save juggy/1989122 to your computer and use it in GitHub Desktop.
- content_for :scripts do
= javascript_include_tag "app/application"
= javascript_include_tag "app/templates/all"
:javascript
S.set("quote", S.store.find(S.models.Quote, S.store.load(S.models.Quote, #{QuoteSerializer.new(Quote.find(params[:id])).to_json}.quote).id));
console.log("data loaded")
- content_for :sidebar do
%script{type:"text/x-handlebars"}
{{view S.views.SidebarView}}
%script{type:"text/x-handlebars"}
{{view Ember.View templateName="app/templates/quote/status_bar"}}
#main.scroll
%script{type:"text/x-handlebars"}
{{view S.views.FadeView controllerBinding="S.controllers.quoteController" templateNameBinding="S.statechart.currentTemplate"}}
S = this.S = Ember.Application.create
# DATA STORE
store: DS.Store.create
revision: 2
adapter: DS.RESTAdapter.create({ bulkCommit: false })
# CONTAINERS
controllers: {}
states: {}
views: {}
models: {}
mixins: {}
# READY
ready: ->
Em.run.once =>
@set "statechart", Ember.RouteManager.create
enableLogging: yes
templateRootPath: "app/templates/states"
initialState: "Quote"
Quote: S.states.Quote
@_super()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment