nullnullnull
nullnullnull

Reputation: 8189

Setting the model in a nested route in Ember.js

I have a nested edit route:

@resource 'dashboard.communities.community', path: ':community_id', ->
  @route 'edit'

In my route, I try to retrieve the model with modelFor:

CivicSourcing.DashboardCommunitiesCommunityEditRoute = Ember.Route.extend

  model: (params, queryParams, transition) ->
    @modelFor('community')

But this returns undefined. The parent route is successfully retrieving the community, though. Any idea what might be going on?

Upvotes: 1

Views: 58

Answers (1)

Kingpin2k
Kingpin2k

Reputation: 47367

You're resource name is dashboard.communities.community not community

@modelFor('dashboard.communities.community')

Here's a similar example for colors.cool

http://emberjs.jsbin.com/OxIDiVU/442/edit

Upvotes: 1

Related Questions