Astcart = Ember.Application.create({});
Astcart.IndexRoute = Ember.Route.extend({
return Astcart.Application.find();
Astcart.IndexController = Ember.ArrayController.extend({
self.get('model').map(function(application) {
var new_cart_item = application.get('cart_items').create({
name: self.get('newProductDesc'),
qty: self.get('newProductQty'),
price: self.get('newProductPrice'),
subtotal: self.get('newProductSubtotal')
deleteproduct: function(product){
if (window.confirm("Are you sure you want to delete this record?")) {
this.get('model').map(function(application) {
application.get('cart_items').removeObject(product);
Astcart.Application = Ember.Model.extend({
logged_in: Ember.belongsTo('Astcart.Logged_in', {key: 'logged_in', embedded: true}),
cart_items: Ember.hasMany('Astcart.Cart_items', {key: 'cart_items', embedded: true})
Astcart.Cart_items = Ember.Model.extend({
Astcart.Logged_in = Ember.Model.extend({
Astcart.Cart_items.adapter = Ember.FixtureAdapter.create();
Astcart.Application.adapter = Ember.FixtureAdapter.create();
Astcart.Application.FIXTURES = [
"name": "Samsung Galaxy Tab 2",
"name": "Samsung Galaxy Tab 2",
"name": "Samsung Galaxy Tab 2",