我在我的模型上创建了一个名为“post”的函数,我想通过自定义 url(下面的示例)通过 POST 请求向服务器发送请求。如何在不影响 rootUrl 发送请求的情况下设置 url?蒂亚!
MyModel = Backbone.Model.extend({
urlRoot: '../mymodel'
initialize: function(){
},
post: function(){
// how put the url here?
// this is the custom url: '../post/mymodel/' + this.model.get('id')
// this is the expected log on server:
// POST: ../post/mymodel/323133
});