EventedMind/iron-router — pull request #80 by richieb (2013-08-26 08:20:51+00:00)
Title: 2 little additions: DOM element for appending layout; and this.render({to:"aNamedYield})

I started using iron-router a bit more today and I added 2 small features:
1. Now you can specify a DOM element ("rootElement") that you want the layout template appended to. So, no need to have the layout appended only to the body tag—unless you want it on the body of course.

Specify the rootElement like this:
``` Router.configure ({
layout :"layout",
rootElement: ".someClassName"
// Or like this this: rootElement: "#someIDName"
})
```

2. To render the template (that corresponds to the route name) to a named yield, just do this:
```
run:function (param1) {
this.render({to:"aNamedYield"})
}
```
Previously, one had to do this: this.render({templateName:{to:"secondary"}}), even if the template name is already automatically set to correspond to the route name.

Note that the templateName is still necessary if you are targeting a different template (one that does not correspond to the name of the route).