Created
August 10, 2013 07:24
-
-
Save Chandler/6199450 to your computer and use it in GitHub Desktop.
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 | |
OrganizationRoute = Em.Route.extend | |
model: (params) -> | |
model = Organization.find(params.organization_id) #can't use default, my models aren't on App namespace (it's a long story) | |
@controllerFor('organizations').set 'selectedModel', model | |
#no OrganizationController, using default | |
OrganizationSettingsController = Em.Controller.extend | |
needs: 'organization' | |
organization: null # good to define a property to null before defining a binding on it | |
organizationBinding: 'controllers.organization' | |
editOrg: -> | |
console.log @get('model') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment