Anybody have dataNotFound working with latest Meteor

Can’t figure out why none of this is working as expected? Seems like no matter what i change, dataNotFound simply doesn’t work.
Yes, I don’t have time to switch to flow router.

Seems like the following works better and is lest crusty anyway (Sorry for the broken CoffeeScript syntax)

@route “articles”,
path: "/articles/:slug"
layoutTemplate: "articleLayout"
data: ->
slug = @params.slug
article = Articles.findOne( slug: slug )
if article
data: article
else @redirect(’/not-found’)
waitOn: -> Meteor.subscribe(‘articles’)

1 Like

I didn’t realize that the API had changed with Iron Router, and this is a correct example of a solution to my problem:

@route “articles”,
path: "/articles/:slug"
layoutTemplate: "articleLayout"
data: ->
slug = @params.slug
article = Articles.findOne( slug: slug )
if article
data: article
subscriptions: -> @subscribe( ‘articles’, @params.slug ).wait()
waitOn: ->
slug = @params.slug
Articles.findOne( slug: slug )