Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

introduces router.navigate, and setting up routes:

  • Loading branch information...
commit fd0f7de874c587e08490d74f155753b1cb5cb4ab 1 parent 7ed2cb0
@webdev authored
View
3  app/assets/javascripts/ready.coffee
@@ -1,3 +1,4 @@
$ ->
window.router = new Cookbook.RecipesRouter
- router.showRecipe(1)
+ Backbone.history.start()
+ router.navigate("recipes/1", true)
View
5 app/assets/javascripts/routers/recipes_router.coffee
@@ -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)->
Please sign in to comment.
Something went wrong with that request. Please try again.