Backbone.js : What's the correct way of using the latest Backbone routes?
So I'm running into a few issues with the latest Backbone.js release 0.9.0. It includes some changes to its routes component. One of the confusing ones is the removal of "leading slashes". There is a discussion on GitHub https://github.com/documentcloud/backbone/issues/848.

With the previous version, I would do

    routes:
      "" : "search"
      "search/:type/:keywords" : "search"

And that would handle all types of scenarios including

    search/a/b
    search//b (when a is null or empty)
    search/a/

But now I have to do

    routes:
      "" : "search"
      "search/:type"  : "search"
      "search/:type/" : "search"
      "search/:type/:keywords" : "search"
      "search/:type/:keywords/" : "search"

In order to make sure different combinations of URL parameters are handled properly.

I understand their rationale on removing this and in that case, am I implementing this correctly? I seem to "over-work" on something that was easily and well handled in the previous version.


Backbone.js : What's the correct way of using the latest Backbone routes?
===

So I'm running into a few issues with the latest Backbone.js release 0.9.0. It includes some changes to its routes component. One of the confusing ones is the removal of "leading slashes". There is a discussion on GitHub https://github.com/documentcloud/backbone/issues/848.

With the previous version, I would do

    routes:
      "" : "search"
      "search/:type/:keywords" : "search"

And that would handle all types of scenarios including

    search/a/b
    search//b (when a is null or empty)
    search/a/

But now I have to do

    routes:
      "" : "search"
      "search/:type"  : "search"
      "search/:type/" : "search"
      "search/:type/:keywords" : "search"
      "search/:type/:keywords/" : "search"

In order to make sure different combinations of URL parameters are handled properly.

I understand their rationale on removing this and in that case, am I implementing this correctly? I seem to "over-work" on something that was easily and well handled in the previous version.

