Moving from Pure Routes to Controllers


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')
  events: ->
  people: ->
  data: ->
      events: @events()
      people: @people()
      ready: @eventsSub.ready

and the route looks like this:

Router.route '/', ->
  name: 'home'

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 in an onBeforeAction?

This code is copied almost verbatim from Microscope. What have I missed here?



I usually do it more like this.

UserController = RouteController.extend({
  viewProfile: function() {
    var user = Meteor.users.findOne(;  // the id parameter
    this.render('userProfile', {
      data: user

Then in the routes part of it {
  this.route('userProfile', {
    waitOn: function() {
      return Meteor.subscribe('userProfile',;
    path: '/user/profile/:id',
    controller: 'UserController',
    action: 'viewProfile'