I am integrating BackBone in a new project. Although I am a little familiar with BackBone, this will be my first attempt to create a new project with it.
I set up the model and view, but I get a console error that does not return any helfpul results in StackOverflow or Google. I hope someone here can determine where I made a mistake.
Here's the error that occurs when I call thing.fetch()
Uncaught TypeError: Cannot read property 'ajax' of undefined
And here is my CoffeeScript code:
Thing = Backbone.Model.extend name: 'thing' url: -> "/things/#{@id}" ThingView = Backbone.Model.extend el: "#thing" render: -> console.log 'render', @$el thing = new Thing(id: 1) thing.fetch() thingView = new ThingView()(model: Thing) thingView.render()
source share