Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second call to {{render}} within the same template fails #10710

Closed
andrewjmc opened this issue Mar 23, 2015 · 4 comments · Fixed by #10712
Closed

Second call to {{render}} within the same template fails #10710

andrewjmc opened this issue Mar 23, 2015 · 4 comments · Fixed by #10712
Assignees

Comments

@andrewjmc
Copy link

Please see this code which works in the current release of Ember, but not in the current beta.

http://jsfiddle.net/yymrk2z3/

The error given is:

Assertion Failed: You cannot provide a template block if you also specified a templateName

My specific use-case is rendering tabs and their contents, which requires two calls to {{render}}

Thanks!

@stefanpenner
Copy link
Member

this appears to be an issue on beta is this correct?

@stefanpenner
Copy link
Member

@ef4 this may be related to some of your work?

@rwjblue
Copy link
Member

rwjblue commented Mar 24, 2015

The error message is kinda silly in this case, but the issue here is that you have specified the template name twice.

{{render "fish" this}} 
App.FishView = Ember.View.extend({
  templateName: 'fish'
});

Removing the duplicate template, fixes the issue in the demo. Working version: http://emberjs.jsbin.com/rwjblue/368/edit?html,js,output

@ef4
Copy link
Contributor

ef4 commented Mar 24, 2015

As far as I can tell this is not related to my changes. It is fallout from htmlbars.

It does appear to be an unintended semantic change that we should fix if possible. Presumably the render helper shouldn't set a template when there's a view class.

That's more in line with how normal outlet-driven renders happen. If there's a view class, just use it and let it manage its own template. Otherwise use the default view class and set its template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants