Solved:
I have a backbone(0.9.2) written in coffeescript as follows
class Animal.Views.Cats extends Backbone.View
template: JST['animals/cats']
...
...
render: ->
$(@el).html(@template())
this
With this coffeescript code, when i execute in browser, i get the following error in console
Property template of object <#cat> is not a function
I am using eco template with rails 3.1 backend where am i going wrong?
solution:
the problem was a deeply nested template file structure
template: JST['mammals/animals/cats'] fixes the problem
in your code 'template' is not defined as a function but as a attribute.
try
ie, insert the function arrow '->'
or, if you do not want that to be a function, then drop the parentheses after @template