jashkenas/backbone — pull request #3109 by maratbn (2014-04-07 02:25:44+00:00)
Title: Pull request for issue #3108 -- Allow proxying of options to 'url(...)' via 'fetch(...)'.

This is an important enhancement that has been rejected several times before, so I'm just giving my 2 cents and hope it will be reconsidered. I would be surprised if this is the last time anybody brings up the need for this feature.

At the crux of the matter is that to insure the Principle of Separation of Concerns, the 'url(...)' method on model/collection should be able to receive additional data on how to compose the URL that should be totally independent of the application/model/collection state.

Some other comments I've seen on this matter is the suggestion to just add to jQuery ajax data in the logic that calls 'fetch(...)', but that would break Separation of Concerns, or to set the data as some field to model/collection, but that would alter state.

This pull request is associated with this issue: https://github.com/jashkenas/backbone/issues/3108

This pull request has a dependency to this Underscore.js pull request: https://github.com/jashkenas/underscore/pull/1100