The case is I want my {{render}}
to infer a controller name from supplied ember-data model's name automatically.
e.g. in {{render 'animal' animal}}
, if animal
is a Cat
, I hope the template is rendered with a CatController
It seems that the render helper accepts a controller=
parameter now, but then regards the parameter as a literal instead of a variable.
For now, I just put the representation codes (needed by template) in target models, which I believe is bad.
What is the right way to implement this polymorphic-alike rendering?