Query parameter support for Controller routes.

This change enables routes to consume query (aka search string)
parameters in routes. Query parameters are always optional, and
a hash of the parameters is always passed as the last argument to
route handlers (even when there are no query parameters in location
bar).

Allowed query parameters can be defined in the `defineRoutes`
method of a `Controller`. Example:

```javascript
// ...
defineRoutes: function () {
  // All routes will consume a `foo` parameter
  this.query('foo');
  this.show('bar', 'showBar', function () {
    // Only routes that match in the `bar` namespace consume a `baz` parameter
    this.query('baz');
  });
},
// ...
```

In the example above, if the following location is visited on the page:

`/bar/1?foo=1&baz=2&unrecognized=3`

The `showBar` route will be called with the following `arguments`:

```javascript
[1, { foo: 1, baz: 2 }]
```
The relationship between `ControllerAction` instances makes up a tree
structure, so the `root` of the tree will not have a parent.


On Tue, Jul 29, 2014 at 11:27 AM, Elli Balcomb <notifications@github.com>
wrote:

> In src/promenade/controller/action.js:
>
> > +    getType: function () {
> > +      return this._type;
> > +    },
> > +
> > +    hasParentAction: function () {
> > +      return !!this.getParentAction();
> > +    },
> > +
> > +    getParentAction: function () {
> > +      return this._parentAction;
> > +    },
> > +
> > +    getPathnameRoot: function () {
> > +      var pathnameRoot = '';
> > +
> > +      if (this.getParentAction()) {
>
> when might we not have a parentAction?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/dabohealth/promenade/pull/77/files#r15542419>.
>



-- 


Chris Joel
Sr. Front End Developer

(925) 271 - 0334
chris@dabohealth.com

Dabo Health, Inc.
49 Powell Street, 2nd Floor
San Francisco, CA 94102

www.dabohealth.com