Skip to content

Instantly share code, notes, and snippets.

@scottmessinger
Created June 10, 2011 03:15
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottmessinger/1018177 to your computer and use it in GitHub Desktop.
Save scottmessinger/1018177 to your computer and use it in GitHub Desktop.
Model has no method '_configure'
Relevant Code:::
var Course = Backbone.Model.extend({
url : function(){
var base = 'courses'
if (this.isNew()) return base;
return base + (base.charAt(base.length-1) == '/'?'' : '/') + this.id;
}
})
App.Controllers.Courses = Backbone.Controller.extend({
routes : {
"courses/:id" : "show",
"" : "index"
//"new" : "newDoc"
},
show : function(id){
var course = new Course({ id : id})
course.fetch({
success: function(){
App.Views.Show({ model : course});
}
})
}
});
ERROR::::
Uncaught TypeError: Object #<Object> has no method '_configure' and this points to line 9 in this gist.
@scottmessinger
Copy link
Author

Solved. I need to add new

    show : function(id){
        var course = new Course({ id : id})
        course.fetch({
            success: function(){
                new App.Views.Show({ model : course});
            }
        })
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment