I’m trying to move some logic out of my routes file and into a controller. So the controller looks like this:
@EventsController = RouteController.extend(
template: 'home'
subscriptions: ->
@eventsSub = Meteor.subscribe('events')
@peopleSub = Meteor.subscribe('people')
return
events: ->
Event.find()
people: ->
Person.find()
data: ->
{
events: @events()
people: @people()
ready: @eventsSub.ready
}
)
and the route looks like this:
Router.route '/', ->
name: 'home'
controller:EventsController
When the page refreshes, I get nothing but there is an error on the console that says:
Route dispatch never rendered. Did you forget to call this.next() in an onBeforeAction?
This code is copied almost verbatim from Microscope. What have I missed here?
Thanks!