d4f / backbone-highway

Routing Backbone with style \o/
MIT License
19 stars 5 forks source link

Using a route as a trigger by declaring it using a path #1

Closed ghost closed 8 years ago

ghost commented 9 years ago
Backbone.Router.map(function() {
  this.route("user_profile", {
    "path": "/user/:id",
    "action": function(userId) { /* Render a cool profile page */ }
  });

  this.route("user_profile_edit", {
    "path": "/user/:id/edit"
    "before": [
      { "path": "/user/$id" }
    ],
    "action": function(userId) { /* Render a cool profile edit form based on the original profile page */ }
  });
});