Created
September 6, 2012 15:23
-
-
Save kraftwer1/3657308 to your computer and use it in GitHub Desktop.
This file contains 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 characters
Mobile.Router = Em.Router.extend | |
enableLogging: true | |
location: "history" | |
root: Em.Route.extend | |
index: Em.Route.extend | |
route: "/" | |
articles: Em.Route.extend | |
# Example URL: /articles/501b7878b19fb834f900005d | |
route: "/articles" | |
showArticle: Em.Route.transitionTo("show") | |
index: Em.Route.extend | |
route: "/" | |
connectOutlets: (router) -> | |
router.get("applicationController").connectOutlet( | |
"articles", Mobile.Article.find() | |
) | |
show: Em.Route.extend | |
route: "/:article_id" | |
connectOutlets: (router, article) -> | |
router.get("applicationController").connectOutlet( | |
"article", article | |
) | |
# Rewrite URL (make sure /:article_id is not being overwritten with null) | |
serialize: (router, article) -> | |
article_id: article.get("_id") | |
# deserialize: (router, params) -> | |
# Mobile.Article.find(params.article_id) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment