Skip to content

Instantly share code, notes, and snippets.

@tarlepp
Forked from anonymous/gist:fba8febb0f444a3b682a
Last active February 11, 2016 06:08
Show Gist options
  • Save tarlepp/e6221d04f26d773e86aa to your computer and use it in GitHub Desktop.
Save tarlepp/e6221d04f26d773e86aa to your computer and use it in GitHub Desktop.
/**
* UserProductsController
*
* @description :: Server-side logic for managing Userproducts
* @help :: See http://sailsjs.org/#!/documentation/concepts/Controllers
*/
module.exports = {
yourAction: function(req, res) {
sails.models.product.find().sort('heat ASC').exec(function (err, products){
if (err) {
return res.negoatiate(err);
}
return res.view('products/user', {
userProducts: products
});
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment