Created
September 12, 2013 15:10
Revisions
-
veader created this gist
Sep 12, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ // these are the routes I'd like to define // // /posts (load all posts) // /posts/all (only here for completeness) // /posts/archived (load only archived posts) // /posts/unpublished (load only unpublished posts) // /posts/1 (load individual post) // the only way I can see doing it in Ember at this point (1.0) App.Router.map({ this.resource('posts', function () { this.route('archived', { path: '/archived' }); this.route('unpublished', { path: '/unpublished' }); this.resource('post', { path: '/:post_id' }); }); }); // this involves a lot of junk code and is still tricky to have the App.PostsController // being the one fetching and the 'posts' template doing the rendering. // what I'd love to see is something like this App.Route.map({ this.resource('posts' , { path: '/:filter', allow_blank: true, values: 'all archived unpublished'.w()} , function () { this.resource('post', { path: '/:post_id'}) }) }); // I'm still digging into the Router code to see if this is even possible. // Am I working at this problem the wrong way? Any help would be appreciated.