Created
April 24, 2015 20:33
-
-
Save dadamssg/d03fb1e32016ae79404e 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/routes/category/index.js | |
import Ember from 'ember'; | |
import Protected from '../protected'; | |
export default Protected.extend({ | |
model: function (params) { | |
var url = this.store.adapterFor('application').getBaseUrl() + '/categories/'+ params.category + '/assets'; | |
this.controllerFor('categories').set('activeCategory', params.category); | |
return Ember.$.getJSON(url).then(function (data) { | |
return data.assets; | |
}); | |
} | |
}); |
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
import Ember from 'ember'; | |
import config from './config/environment'; | |
var Router = Ember.Router.extend({ | |
location: config.locationType | |
}); | |
export default Router.map(function() { | |
this.route('login', { path: '/login' }); | |
this.route('register', { path: '/register' }); | |
this.route('confirm', { path: '/confirm/:token'}); | |
this.route('forgot', { path: '/forgot'}); | |
this.route('change-password', { path: '/change-password/:token'}); | |
this.resource('admin', { path: '/admin' }, function () { | |
this.resource('account', { path: '/account' }, function() { | |
this.route('picture', { path: '/picture'}); | |
}); | |
this.resource('categories', { path: '/categories' }, function () { | |
this.resource('category', { path: '/:category' }, function () { | |
this.route('add_asset', { path: '/add'}); | |
}); | |
}); | |
this.resource('assets', { path: '/assets' }, function () { | |
this.route('asset', { path: '/:id' }); | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment