This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App = Em.Application.create() | |
App.Router.map -> | |
@resource 'organizations', path: 'orgs', -> | |
@resource 'organization', path: ':organization_id', -> | |
@route 'index', path: '/' | |
@route 'settings' | |
# the route for all organizations | |
App.OrganizationsRoute = Em.Route.extend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router.map -> | |
@resource 'organizations', path: "/orgs", -> | |
@resource 'organization', path: ":organization_id", -> | |
@route 'settings' | |
@route 'home' | |
#no OrganizationsRoute, skipping for now don't need the page for all orgs yet | |
OrganizationsController = Em.ArrayController.extend | |
selectedModel: null |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#scenario 1 /orgs/17/settings | |
OrganizationRoute = Em.Route.extend | |
model: (params) -> | |
model = Organization.find(params.organization_id) | |
@controllerFor('organizations').set 'selectedModel', model | |
OrganizationSettingsController = Em.Controller.extend | |
needs: 'organization' | |
organization: null | |
organizationBinding: 'controllers.organization' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OrganizationRoute = Em.Route.extend | |
model: (params) -> | |
Organization.find(params.organization_id) | |
#visiting /orgs/5/settings renders the "organization" template, and the "organziation.settings" template | |
#in the "organization" template and OrganizationController context, I have access to the model setup above. | |
#in the "organziations.settings" template and OrganiationSettingsController context I have no model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@resource 'organizations', path: "/orgs", -> | |
@resource 'show', path: ":organization_id", -> | |
@route 'settings' | |
visiting /orgs/17/settings renders 'settings' template into the outlet of the 'application' template. | |
I want it to render the templates into the outlets of the parents | |
settings -> show -> organizations -> application |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##EDIT possible solution: | |
OrganizationsNewController = Em.ObjectController.extend | |
fields: Em.Object.create | |
name: '', | |
##Original Question: | |
#this works, I can bind to name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* hello.cpp | |
The Standard "hello world" program | |
Chandler Abraham August 25th, 2007 | |
*/ | |
# include <iostream> | |
using namespace std; | |
void showprogramHeader (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This works | |
grunt.initConfig({ | |
coffee: { | |
glob_to_multiple: { | |
options: { | |
bare: true | |
}, | |
flatten: true, | |
expand: true, | |
cwd: 'client', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(["ember"], function(Em) { | |
var Router; | |
Router = Em.Router.extend({ | |
enableLogging: true, | |
location: 'history' | |
}); | |
Router.map(function() { | |
this.route('discovery'); | |
this.resource('organizations', { |