2

I'm looking for a way to use Rails-routes-like globbing in Ember.Router (1.0pre).
My goal is to match a path as a dynamic segment.

I'd like to have a route like that (CoffeeScript) :

App.Router = Ember.Router.extend
    location: 'hash'
    enableLogging: true
    root: Ember.Route.extend
        myRoute: Ember.Route.extend
            route: '/:path*'
            connectOutlets: (router, context) ->
                { ... something here ... }

Unfortunately, Ember._RouteMatcher does not seem to support that kind of syntax (the trailing asterisk in the route), so I'm unable to create a route that would match a dynamic segment like '/long/path/to/something'.

Has anyone ever managed to do that (or found some kind of workaround) ?

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
Michael Baudino
  • 173
  • 1
  • 7
  • My question is close to [NoirBizarre's one](http://stackoverflow.com/questions/11151423/ember-js-routing-match-end-of-url). Has anyone else tried to do that ? – Michael Baudino Aug 12 '12 at 07:07
  • The 10th item in the [changelog for 1.0.0-pre.2](https://github.com/emberjs/ember.js/blob/master/CHANGELOG) (released Oct 25th): "Adds support for globbed routes". Haven't tried it or seen anything else about it. – Alex Nov 05 '12 at 10:58
  • Yep, this commit shold have fixed the problem : https://github.com/emberjs/ember.js/commit/9e8cf4579e177f66c4986efd48fa6fdeb5b73ff1#packages/ember-routing/lib Unfortunately, I did not have time to test it, yet. – Michael Baudino Nov 05 '12 at 18:08

0 Answers0