I have the backbone.js view below:
class MyApplication.Views.Cake extends Backbone.View
tagName: 'li'
className: 'cake'
and the attempted subclass
class MyApplication.Views.AwesomeCake extends MyApplication.Views.Cake
However in the javascript console the following error is thrown on the subclass:
Uncaught TypeError: Cannot read property 'prototype' of undefined
I found out that my issue was a problem with Rails 3.1 and the asset pipeline. Since sprockets loads the javascript files in alphabetical order (and because awesome_cake comes before cake) I needed to require the superclasses file.
Solution found in question:
Backbone.js – Coffeescript extends