Permalink
Browse files

introduces router.navigate, and setting up routes:

  • Loading branch information...
webdev committed Nov 8, 2011
1 parent 7ed2cb0 commit fd0f7de874c587e08490d74f155753b1cb5cb4ab
Showing with 7 additions and 1 deletion.
  1. +2 −1 app/assets/javascripts/ready.coffee
  2. +5 −0 app/assets/javascripts/routers/recipes_router.coffee
@@ -1,3 +1,4 @@
$ ->
window.router = new Cookbook.RecipesRouter
- router.showRecipe(1)
+ Backbone.history.start()
+ router.navigate("recipes/1", true)
@@ -1,5 +1,10 @@
class Cookbook.RecipesRouter extends Backbone.Router
+
+ routes:
+ "recipes/:id": "showRecipe"
+
constructor: ->
+ super
@recipeView = new Cookbook.RecipeView(el: $("#recipe-view"))
showRecipe: (id)->

0 comments on commit fd0f7de

Please sign in to comment.