I am following a template for dynamically choosing which model, route, controller to render with a render helper, as outlined in this question (and elsewhere). My problem is that we want to run with the Ember.ENV.RAISE_ON_DEPRECATION
flag set, to catch problems before they develop into upgrade nightmares. I am calling Ember.Render from a handlebars helper, like this:
Ember.Handlebars.registerBoundHelper('renderModuleEdit', function(callingContext, module, options) {
var modelName = callingContext.get('type').get('modelName');
return Ember.Handlebars.helpers.render.call(callingContext, "edit_" + modelName, modelName, options);
});
The template has this code in it:
{{#each module in modules}}
<div class="tab-content" {{bind-attr class="module.active:active"}}>
{{renderModuleEdit module module}}
</div>
{{/each}}
The problem is that render fails on the test for āquoteless parametersā, even though Iām using call() on it, rather than a direct handlebars template syntax. The test is defined in the source on this line. The actual test is options.types[0] !== 'ID
ā, and while the options parameter is available in the register helper function (first code block above), and thus I would be able to change the 1st type away from 'ID'
, Iām not sure what I can change it to that wouldnāt cause something else to subtly break later. The error message comes through as:
Uncaught Error: Using a quoteless parameter with {{render}} is deprecated. Please update to quoted usage '{{render āedit_Introā}}.
As I am not using {{render edit_Intro}} to make this call, I have no idea how to correct this. If I change the template code to {{renderModuleEdit āmoduleā āmoduleā}}, then the parameters to my renderModuleEdit come through as strings of āmoduleā rather than the model instance I need.
I feel like I have no understanding of what this test is actually for and what the āquotelessā vs āquotedā parameters even mean. Can someone explain this? Is there a way around this deprecation warning for calling render from a registered bound handlebars helper like this?
I am cross posting this from StackOverflow because, the more I think about it, this is not a straightforward āpractical, answerableā question. Itās a pretty in-depth, advanced usage causing the conflict between the render helper and the environment flag.