Skip to content

Instantly share code, notes, and snippets.

@bradleypriest
Forked from Neppord/router.js
Created July 11, 2012 07:40

Revisions

  1. bradleypriest revised this gist Jul 11, 2012. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions router.js
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,19 @@
    App.Router = Em.Router.extend({
    root: Em.Route.extend({
    route: '/',
    post: Em.Route.extend({
    route: '/:user_id/:post_id',
    user: Em.Route.extend({
    route: '/:user_id/',
    connectOutlets: function (router, context) {
    //What is context here?
    // it's simple in the one segment case where
    // its the return value of find on the model.
    }
    },
    index: Em.Route.extend({
    redirectsTo: "post"
    }),
    post: Em.Route.extend({
    route: "/post_id"
    })
    })
    })
    })
  2. @Neppord Neppord created this gist Jul 11, 2012.
    13 changes: 13 additions & 0 deletions router.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    App.Router = Em.Router.extend({
    root: Em.Route.extend({
    route: '/',
    post: Em.Route.extend({
    route: '/:user_id/:post_id',
    connectOutlets: function (router, context) {
    //What is context here?
    // it's simple in the one segment case where
    // its the return value of find on the model.
    }
    })
    })
    })