I have a list of items and clicking on them should bring to user details on it (another view). In my router I have such a route for this:
'details/:id' : 'details',
Now, in details function I should fetch my object (Fetching will trigger new view rendering). But what should i do so that backbone attach item id to model.url? 2 ways i have for now is:
Create url on the fly when fetching:
this.realty_object.fetch({url: SITE_PATH + 'blah/blah/' + id});
And something like this:
this.realty_object
.set({id : id}, {silent: true})
.fetch();
But I have doubts that it is right solutions. How it should be? What is the difference between model.urlRoot and model.url().