Last active
December 22, 2015 09:38
-
-
Save dlai0001/6452827 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
# Product model | |
App.Product = DS.Model.extend( | |
descripton: DS.attr('string') | |
expirationDate: DS.attr('date') | |
imageUrl: DS.attr('string') | |
location: DS.attr('string') | |
quantity: DS.attr('number') | |
quantityUnit: DS.attr('string') | |
type: DS.attr('string') | |
profile: DS.belongsTo('profile') | |
) | |
# Map Main Routes in the application. | |
App.Router.map ( -> | |
@route "index", path: "/" | |
@route "register", path: "/register" | |
@route "messages", path: "/messages" | |
@resource "myfruits", path: "/myfruits", ( -> | |
@route "item", path: "/:product_id" | |
@route "new", path: "/new" | |
return | |
) | |
) | |
App.MyfruitsItemRoute = Ember.Route.extend( | |
renderTemplate: ( -> | |
@render("myfruits-item", {outlet: "itemview"}) | |
return | |
) | |
model: ( (params) -> | |
return @store.find('product', params.product_id) | |
) | |
setupController: ((controller, model) -> | |
@controllerFor('myfruits').set('myfruitsItemSubroute', true) | |
controller.set('model', model) | |
return | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment