Permalink
Browse files

RecipeRouter with a showRecipe

  • Loading branch information...
1 parent 2ba6180 commit 1e32587d816bf75a4f7a75a85c595333bc5bbdc6 @dougalcorn dougalcorn committed with Nov 1, 2011
Showing with 8 additions and 0 deletions.
  1. +8 −0 app/assets/javascripts/routers/recipes_router.coffee
@@ -0,0 +1,8 @@
+class Cookbook.RecipesRouter extends Backbone.Router
+
+ constructor: ->
+ @recipeView = new Cookbook.RecipeView(el: $("#recipe-view"))
+
+ showRecipe: (id)->
+ @recipeView.model = new Cookbook.Recipe(id: id)
+ @recipeView.model.fetch success: => @recipeView.render()

0 comments on commit 1e32587

Please sign in to comment.