               else
                 console.log err
                 res.redirect 'shopmanagement/deals/list'
-            
+
   else
     fs.unlink file.path
-    res.render "shopmanagement/deals/edit",
+    res.render "pages/shopmanagement/deals/edit",
     {
       errorMsg: 'El formato debe ser jpg, png o gif',
       deal: dealId,

            else
              console.log err
              res.redirect 'shopmanagement/deals/list'
      
   else
    fs.unlink file.path
    res.render "shopmanagement/deals/edit",
    {errorMsg: 'El formato debe ser jpg, png o gif', deal: dealId, currentShop: req.session.currentShop}

exports.edit = (req, res) ->
  shopId = req.session.currentShop.shopId
  dealId = req.params.dealId
  
  Deal.findOne({_id: req.params.dealId}).exec( (err, deal) ->
   
    DealCategory.find().sort('name').exec( (err, categories ) ->
      res.render 'pages/shopmanagement/deals/create',
        {

exports.delete = (req, res) ->
  shopId = req.session.currentShop.shopId
  dealId = req.params.dealId

  Deal.findOne({_id: req.params.dealId}).exec (err, deal) ->

    res.render 'pages/shopmanagement/deals/delete',
      {
        deal: deal,
