zowens/ASP.NET-MVC-JavaScript-Routing — Issue #3: Default pattern like {controller}/{action}/{id} always generate '/' url
Author: MadRabbitKiller
Created: 2011-11-14 06:43:04+00:00
State: open

There is a little bug in the ```formatUrl``` function call. Anytime I tried to generate url based on the default pattern like this one ```{controller}/{action}/{id}```, the result was '/'. While debugging I had saw that the ```formatUrl``` function always accept the default set of data. I.e. if you try to call ```$.routeManager.action({controller: 'SomeController', action: 'SomeAction'})``` the ```formatUrl``` function will work with data like ```{controller: 'Home', action: 'Index'}```. I suspect the problem is in wrong using of this construction: ```$.extend({}, data, r.defaultValues)```. It always overwrites new data with default values.