I'm working on a Node.js app with Express.js and Mongodb and I'm having some trouble getting it to cooperate with me. The app is essentially a list of Recipes with it's ingredients. It works fine when I start the App. I can click to view a recipe and it shows the right one but the second I create a new one it seems to get "stuck" and the only recipe I'll see is the newly created one. But it shows the title to the right recipe on the top. Which is really confusing me.
Here's a Screenshot of what's happening if that helps at all. This is what's happening when I create an Eggs Benedict Recipe and click on the already existing "Chili" recipe:

Here's my Code:
Recipe_show.jade
h1= title
div.recipe
div.name= recipe.name
- each ingredient in recipe.ingredients
div.ingredient
div.amount= ingredient.amount
div.measurement= ingredient.measurement
div.type= ingredient.type
recipeprovider.js
//find an recipe by ID
RecipeProvider.prototype.findById = function(id, callback) {
this.getCollection(function(error, recipe_collection) {
if( error ) callback(error)
else {
recipe_collection.findOne({_id: recipe_collection.db.bson_serializer.ObjectID.createFromHexString(id)},
function(error, result) {
if( error ) callback(error)
else callback(null, result)
});
}
});
};
app.js
// show individual recipes
app.get('/recipe/:id', function(req, res) {
recipeProvider.findById(req.params.id, function(error, recipe) {
res.render('recipe_show.jade', {
title: recipe.name,
recipe: recipe
});
});
});