Skip to content

Instantly share code, notes, and snippets.

@Chandler
Last active December 18, 2015 09:39
Show Gist options
  • Save Chandler/5763086 to your computer and use it in GitHub Desktop.
Save Chandler/5763086 to your computer and use it in GitHub Desktop.
#when I visit /orgs/5, my route's model method isn't called with the dynamic segment.
Broken:
App.Router.map ->
@resource 'organizations', path: "/orgs", ->
@resource 'organization', path: ":id", ->
App.OrganizationIndexRoute = Ember.Route.extend
model: (params) ->
console.log(params)
>> Object {}
Working:
App.Router.map ->
@resource 'organizations', path: "/orgs", ->
@route 'show', path: ":id", ->
App.OrganizationsShowRoute = Ember.Route.extend
model: (params) ->
console.log(params)
>>Object {id: "5"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment