I've got a node.js (server) and backbone.js (client) app - I can load and init my backbone app on a page... and init the router, but my default route (".*") is not getting called. I can manually call the index function after I initialize the router, but I don't have to take that step when I've built backbone apps over rails.
Does anyone have a clue as to why this is happening?
adding code (in coffeescript):
class NodeNetBackbone.Routers.RegistryPatients extends Backbone.Router
routes:
'' : 'index'
'.*' : 'index'
'/index' : 'index'
'/:id' : 'show'
'/new' : 'new'
'/:id/edit' : 'edit'
initialize: ->
console.log 'init the router'
@registry_patients = new NodeNetBackbone.Collections.RegistryPatients()
# TODO: Figure out why this isn't sticking...
@registry_patients.model = NodeNetBackbone.Models.RegistryPatient
# TODO: Try to only round trip once on initial load
# @registry_patients.reset($('#container_data').attr('data'))
@registry_patients.fetch()
# TODO: SSI - why are the routes not getting processed?
this.index()
index: ->
console.log 'made it to the route index'
view = new NodeNetBackbone.Views.RegistryPatients.Index(collection: @registry_patients)
# $('#container').html('<h1>Patients V3: (Backbone):</h1>')
$('#container').html(view.render().el)
'*.'. It's only''(an empty string). - Nemanja Miljković