var crumbModel = require('../models/crumbModel.js');

module.exports = {
  showAll: function(req, res) {
    crumbModel.find(function(err, crumbs) {
      if(err) {
        return res.json(500, {
          message: 'Error getting crumbs',
          error: err
        });
      }
      return res.json(crumbs)
    });
  },
  create: function(req, res) {
    var crumb = new crumbModel({
      trip : req.body.trip,
      latitude : req.body.lat,
      longitude : req.body.long
    });
    
    crumb.save(function(err, crumb) {
      if(err) {
        return res.json(500, {
          message: 'Error saving crumb',
          error: err
        });
      }
      return res.json({
        message: 'saved',
        _id: crumb._id
      });
    });
  }
};
@@ -742,14 +742,306 @@
     %7D);%0A
+  %7D,%0A  delete: function(req, res) %7B%0A    crumbModel.remove(%7B%0A      _id : req.params.crumb_id%0A    %7D, function(err, crumb) %7B%0A      if(err) %7B%0A        return res.json(500, %7B%0A          message: 'Error deleting crumb',%0A          error: err%0A        %7D);%0A      %7D%0A      return res.json(crumbs);%0A    %7D);%0A
   %7D%0A%7D;

Delete Function