Skip to content

Commit

Permalink
Merge pull request #1100 from lirbank/patch-1
Browse files Browse the repository at this point in the history
Update Guide.md
  • Loading branch information
cmather committed Dec 9, 2014
2 parents 3414ca2 + 6adb9a4 commit 282e300
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -912,6 +912,22 @@ Router.plugin('dataNotFound', {notFoundTemplate: 'notFound'});
This out-of-box plugin will automatically render the template named "notFound"
if the route's data is falsey (i.e. `! this.data()`).
### Applying Plugins to Specific Routes
You can apply a plugin to a specific route by passing an `except` or `only` option
to the respective plugin function. This is useful for server routes, where you
explicitly don't want to run plugins designed for the client.
```javascript
Router.plugin('dataNotFound', {
notFoundTemplate: 'NotFound',
except: ['server.route']
// or only: ['routeOne', 'routeTwo']
});
```
In the above example, the dataNotFound will be applied to all routes except the
route named 'server.route'.
### Creating Plugins
To create a plugin just put your function on the `Iron.Router.plugins` object
like this:
Expand Down

0 comments on commit 282e300

Please sign in to comment.