Take the tour ×  In Backbone.js I can appoint where the model
fetches it's data:  var mybook = new Book({id: "1"});
mybook.fetch();  //it will access '/books/1'  But if I want to
append a query string after the URL? e.g. the book data is at
/books/1&details=true. Can I specify this in model?
share|improve this question add comment  2 Answers  up vote 16
down vote accepted  You will have to use a custom url function
for the model.  Book.url = function() {   return this.urlRoot +
'/' + this.id + '?details=true'; share|improve this answer add
comment  You can also use the option for the method fetch
mybook.fetch({data:{details: true}}); share|improve this answer
Although the accepted comment works, this seems to be the
'backbone way' –  Tom Dec 4 at 9:37 add comment  Your Answer