Ember Version: 1.0.0 e2ea0cf (2013-08-31 23:47:39 -0700)
Take this example:
App.Post = Ember.Object.extend
findComment: (id) ->
jQuery.Deferred().reject("notFound")
# Base Route
#
App.Route = Ember.Route.extend
actions:
error: (error, transition) ->
# maybe you render a not found partial into the route, maybe
# you render a flash message into the application
# /post/:post_id
#
App.PostRoute = App.Route.extend
model: (params) ->
App.Post.find(params.post_id)
# /post/:post_id/comments/:comment_id
#
App.CommentRoute = App.Route.extend
model: (params) ->
# Will be rejected
@modelFor('post').findComment(params.comment_id)
Here’s what happens:
- Vist
/post/1/comments/1
directly -
App.PostRoute#model
returns a post -
App.CommentRoute#model
returns a rejected promise - Nothing renders (not the application or the post route)
Here’s what I would like to happen:
- Vist
/post/1/comments/1
directly -
PostRoute#model
returns a post -
CommentRoute#model
returns a rejected promise -
ApplicationRoute
renders theapplication
template -
PostRoute
renders thepost
template -
CommentRoute.actions#error
renders anotFound
partial intopost
Is this possible?