Skip to content
This repository has been archived by the owner on May 26, 2019. It is now read-only.

Clarification on Rendering with Helpers #214

Closed
ryanjm opened this issue Apr 8, 2015 · 4 comments
Closed

Clarification on Rendering with Helpers #214

ryanjm opened this issue Apr 8, 2015 · 4 comments

Comments

@ryanjm
Copy link

ryanjm commented Apr 8, 2015

Small confusion on this page.

It first states:

{{render}} takes two parameters:

  • The first parameter describes the context to be setup
  • The optional second parameter is a model, which will be passed to the controller if provided

Then states:

  • When no model is provided it gets the singleton instance of the corresponding controller
  • When a model is provided it gets a unique instance of the corresponding controller

Then it gives an example where the code is:

<h1>{{title}}</h1>
<div>{{body}}</div>
{{render "author" author}}

In this case render gets two arguments, including a model. The description for this section states:

  • Get (or generate) the singleton instance of AuthorController

I believe this is wrong. I believe that it should be "Creates a unique instance of AuthorController". I think this is left over from when it used to only create a singleton.

@ryanjm
Copy link
Author

ryanjm commented Apr 8, 2015

Also, on this page, it would be helpful in the "COMPARISON TABLE" to include {{outlet}} since it was just stated that they are similar.

I think another paragraph further explaining when you would use {{outlet}} vs {{render}} would be super helpful.

@dpdawson
Copy link
Contributor

I think it would also be more clear if it included the AuthorController code with the author object defined.

@locks
Copy link
Contributor

locks commented Jun 27, 2015

I believe this is wrong. I believe that it should be "Creates a unique instance of AuthorController". I think this is left over from when it used to only create a singleton.

Aren't Ember.Controller singleton by default?

Also, on this page, it would be helpful in the "COMPARISON TABLE" to include {{outlet}} since it was just stated that they are similar.

If they're similar what's the need? {{outlet}} is previously explained in The Application Template.

I think it would also be more clear if it included the AuthorController code with the author object defined.

You're not setting the author property of controller:author, you're setting the model property, like Ember.Route#model.

Most importantly though, is that this section is essentially deprecated for v2.0.0 so I'm not sure the investment is worthwhile. The feedback is appreciated though.

@michaelrkn
Copy link
Contributor

@locks if this should be closed, can you ask @rwjblue to do so? Thanks!

@rwjblue rwjblue closed this as completed Jul 13, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants