jcarlson/spine — pull request #1 by jcarlson (2013-07-04 03:20:46+00:00)
Title: Add support for redirecting unmatched routes

For applications transitioning to an all-client Spine implementation,
enabling `redirect` in the Spine router will allow unmatched routes to
escape to the browser and are handled by a simple `window.location=`.

For example, suppose I have finished implementing the new List Projects
screen in Spine, but I have not yet implemented the New Project screen
(it is still plain-old HTML/HTTP request/response).

The List Projects controller shouldn't care whether a New Project
controller has been implemented in Spine or if that navigation needs to
be a hard page refresh. By enabling redirects, the List Projects
controller can handle navigational duties using a consistent API.

This is a much bigger issue when HTML5 history support is enabled, as
you can't `pushState` with a plain-old tag the same way you can
change the current hash.

To enable this feature, pass `redirect: true` as an option to the Spine
router during setup, such as:

`Spine.Route.setup(history: true, redirect: true)`

Also see: https://groups.google.com/forum/#!topic/spinejs/bAY1NC6jKoc