Doesn't render into outlet within {{render}}
Can't render to outlet, which is in a view, rendered by {{render}} helper
<script type="text/x-handlebars" data-template-name="details">
{{outlet info}}
</script>
<script type="text/x-handlebars" data-template-name="main">
{{render details}}
</script>
renderTemplate: function(){
this.render('itemInfo',{ outlet: 'info' })
}
http://jsfiddle.net/wCWKH/5/
Seeing your fiddle, I think there is no bug here, because, when I read this.render('info', { into: 'main', outlet: 'info'});, I guess it will render the template info, into the template main, in the outlet info. But in your template main, there is no outlet info. Replacing main by informer makes the code working.
Perhaps there could be a warning when an outlet is not found in the expected template.
I see, but into option should specify route name, not tempate name (https://github.com/emberjs/ember.js/issues/2178), am I wrong?
Also render({into:informer}) not working for HEAD.
Working on this.
The documentation on this page:
http://emberjs.com/guides/routing/rendering-a-template/
specifies that the "into" argument is for the template you're rendering into. Thus, as sly7-7 says, you should replace "main" by "informer" to make this work.
Please close this bug - render performance matches spec.
It could be useful to have a warning, I agree.
For others who are running into problems with this -- in my case it was when the render is called by an event which is triggered by entering a different route than the one that renders the template containing the outlet, and caused the error Cannot call method 'connectOutlet' of undefined -- you can try using Ember.run.next:
SomeRoute = Ember.Route.extend({
renderTemplate: function(){
Ember.run.next(this, function() {
this.send('eventWhichRendersIntoANamedOutlet');
});
});
This worked for me but is pure cargo-cult -- I don't know why/how. I traced into Route#appendView, and this line:
var parentView = route.router._lookupActiveView(options.into);
returns null without adding the asynchronicity, but I didn't dig any deeper.
@lastobelus Thank you for that remark. I wanted to render into different outlets based on if the page was a dashboard page or a main page. It looks like having 2 outlets inside of the application template based on if blocks messes things up if I'm correct. I just put my outlets inside 2 separate rendered views. You saved my day. Gracias.
@lastobelus I just ran into this problem as well. Attempting a transition on a nested route via hard browser refresh which has a promise failure lead to the same problem. My error action handler tries to render into an outlet on the main application view but route.router._lookupActiveView(options.into); returns undefined because the ApplicationRoute's _activeViews array is empty at that point and so the lookup for a view called 'application' returns undefined. The code then proceeds to try and call connectOutlet on undefined :(
Doing the Ember.run.next() did not help in this case unfortunately and I haven't found a solution yet.
Please re-open.