I'm not the first person to ask this... the answers basically say "Well you're doing REST wrong." Fair enough, but development is filled with tradeoffs and I often find myself not in a position to rewrite the API.
Moving on to the problem at hand, what's the most elegant way to add a method for some resource to a model?
var Issue = can.Model.extend({
findAll: 'GET Issues',
findOne: 'GET Issues/{id}',
findRelated: can.Model.makeFindAll(function(params) {
return can.ajax({
type: 'GET',
url: 'Issues/'+params.id+'/'
});
})
},{});