Last active
August 29, 2015 14:02
-
-
Save mattboldt/fb32da812ef28f6a5a6f 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
App.Router.reopen | |
location: 'history' | |
rootURL: '/u/' | |
App.Router.map -> | |
@resource('documents', path: '/') | |
@resource('document', path: '/:document_slug/:document_id') | |
App.DocumentRoute = Ember.Route.extend | |
# allows us to use slug as the url | |
serialize: (model, params) -> | |
{ | |
document_id: model.get('id'), | |
document_slug: model.get('slug') | |
} | |
model: (params) -> | |
@store.find('document', params.document_id).then (model) -> | |
model.reload() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment