d4f / backbone-highway

Routing Backbone with style \o/
MIT License
19 stars 5 forks source link

Better support for complicated routes #22

Closed ghost closed 8 years ago

ghost commented 8 years ago

Need to support routes with optional parts that do not contain any parameters, for example:

// Path for a route named 'users'
/users(/:id)(/)

This route works for all these urls when executing the url on first load:

But when navigating to the given route using the go method, Highway will try to inject an inexisting parameter resulting in a corrupted path, for example:

Backbone.Highway.go('users', [42]);
// Will generate the path: /users/42undefined
ghost commented 8 years ago

Released with tag 0.6.1, commit: 7e99c8e