[Solved] Blaze: helper on inclusion helper, correct syntax?


#1

Hello, I can´t not find documentation for this. I just want a dynamic generated form Id.
I know formId helpers double braces is incorrect inside inclusion is just for emphasize.

template

<template name = "newPersona">
  <div>
    {{#autoForm schema=schemas.perfil id={{formId "perfil"}} template="bootstrap3-horizontal"}}
      {{> afQuickFields omit=""}} 
    {{/autoForm}}
 </div>
</template>

helper

const
  _formId = 'newPersonaForm',
  _schemas = {
    perfil: Orgz.schemas.Perfil,
  }

Template.newPersona.helpers({
  schemas() { return _schemas },
  formId(s = '') { return _formId + s }
})

I can do like schemas.perfil whith a const object but I prefer a generated string for this case.
Thanks.


#2

Answer to my self …

<template name = "newPersona">
  <div>
    {{#autoForm schema=schemas.perfil id=(formId "perfil") template="bootstrap3-horizontal"}}
      {{> afQuickFields omit=""}} 
    {{/autoForm}}
 </div>
</template>

found On:
https://github.com/meteor/meteor/blob/devel/packages/spacebars/README.md#nested-sub-expressions