I would like to collect extra segments from the Ember router in an array.
Here is a made-up path to illustrate what I mean:
this.route('group', {path: 'group/:group_id(/:segments[])*'}, function() {
Is it possible to use a request like this:
GET /group/123/some/path/segments
And have them collected in an array?
group.id = 123
segments = ['some', 'path', 'segments']
Or is there any way to define optional segments, so I can just add many and collect them manually?
Under the hood, the router is using route-recognizer to determine the routes. There is the notion of
star-segmentsThis seems like what you're looking for
As a side note, this is my usual 404 approach:
routes/not-found.js:
not-found.hbs
such that
/foo/baryields:404: /foo/bar not found!