I was following the backbonerails.com screencast episode 6. But I can't get the routing to work as it was explained.
Here is my code that is similar to what the screencast suggest:
@Report.module "UsersApp", (UsersApp, App, Backbone, Marionette, $, _) ->
class UsersApp.Router extends Marionette.AppRouter
initialize: ->
console.log "Happy days"
appRoutes:
"users" : "listUsers"
API =
listUsers: ->
console.log "hallo"
App.addInitializer ->
console.log "cheers"
new UsersApp.Router
controller: API
As you can see I have tried to add console.log in a few places to make sure the addInitializer is working and that the Router is started... but still the routing to #users does not do the corresponding console.log
I have this where I define the app:
App.on "initialize:after", ->
if Backbone.history
Backbone.history.start()
So that should run after router has started, if I understand it all.