I have a basic Spine/coffeescript app and I am trying to get the parameters out of the route that I have set up, by looking at examples of other applications. Here is the basic stack:
class Main extends Spine.Stack
el: "#main"
controllers:
sources: Sources
default: 'sources'
routes:
'/sources/:id': 'sources'
Here is the sources controller:
class Sources extends Spine.Controller
el: '#something'
constructor: ->
super
active: (params) ->
super
@id = params.id
@refresh()
@render()
However, params
is undefined when active is called. I am navigating to /#/sources/soemthing
. Maybe there is something about the sugar in the stack that I don't understand, but the example I've seen seems to just work in this way. Can anyone tell me what is missing?