Skip to content

Instantly share code, notes, and snippets.

@softwarerero
Last active December 30, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save softwarerero/7840739 to your computer and use it in GitHub Desktop.
Save softwarerero/7840739 to your computer and use it in GitHub Desktop.
Meteor Autoform not bound to Collection2 object
<head>
<title>autoform01</title>
</head>
<body>
{{> consulta}}
</body>
<template name="consulta">
<p>If the form is commented out the value of consulta.ruc is displayed.</p>
<p>RUC: {{consulta.ruc}}</p>
<p>If this form is present not ruc get displayed anywhere.</p>
{{#autoForm schema=scheme doc=consulta}}
{{afQuickField "ruc"}}
<div>
<button type="submit" class="update">Guardar</button>
</div>
{{/autoForm}}
</template>
Consultas = new Meteor.Collection2("consultas", {
schema: {
ruc: {
type: String,
label: "RUC"
}
}
});
Consultas.allow({
insert: function() {
return true;
},
update: function() {
return true;
},
remove: function() {
return true;
},
fetch: []
});
if (Meteor.isClient) {
Meteor.subscribe("consultas");
ConsultasForm = new AutoForm(Consultas);
Template.consulta.helpers({
scheme: function() {
return Consultas;
},
consulta: function() {
return Consultas.findOne({ ruc: "123456" });
}
});
};
if (Meteor.isServer) {
Consultas.remove({});
Consultas.insert({"ruc": "123456"});
Meteor.startup(function () {
Meteor.publish("consultas", function() {
Consultas.find();
});
});
}
Exception from Deps recompute: @http://localhost:3000/packages/autoform.js?f12ff854fcd95a6ffaed22b0916cf8d77b0e5344:222
Handlebars.evaluate/invoke/apply@http://localhost:3000/packages/handlebars.js?c2b75d49875b4cfcc7544447aad117fd81fccf3b:276
Handlebars.evaluate/invoke@http://localhost:3000/packages/handlebars.js?c2b75d49875b4cfcc7544447aad117fd81fccf3b:301
Handlebars.evaluate/template/</html<@http://localhost:3000/packages/handlebars.js?c2b75d49875b4cfcc7544447aad117fd81fccf3b:385
Spark.labelBranch@http://localhost:3000/packages/spark.js?3a050592ceb34d6c585c70f1df11e353610be0ab:1171
Handlebars.evaluate/template/branch@http://localhost:3000/packages/handlebars.js?c2b75d49875b4cfcc7544447aad117fd81fccf3b:355
Handlebars.evaluate/template/<@http://localhost:3000/packages/handlebars.js?c2b75d49875b4cfcc7544447aad117fd81fccf3b:384
_.forEach@http://localhost:3000/packages/underscore.js?13ab483e8a3c795d9991577e65e811cd0b827997:130
Handlebars.evaluate/template@http://localhost:3000/packages/handlebars.js?c2b75d49875b4cfcc7544447aad117fd81fccf3b:358
Handlebars.evaluate@http://localhost:3000/packages/handlebars.js?c2b75d49875b4cfcc7544447aad117fd81fccf3b:412
Handlebars.json_ast_to_func/<@http://localhost:3000/packages/handlebars.js?c2b75d49875b4cfcc7544447aad117fd81fccf3b:46
Template.__define__/partial/html</html</html<@http://localhost:3000/packages/templating.js?5944cd5e16b26fbf83959a0fe92d7754029a624d:196
currentRenderer.withValue@http://localhost:3000/packages/spark.js?3a050592ceb34d6c585c70f1df11e353610be0ab:81
.materialize@http://localhost:3000/packages/spark.js?3a050592ceb34d6c585c70f1df11e353610be0ab:270
Spark.renderToRange@http://localhost:3000/packages/spark.js?3a050592ceb34d6c585c70f1df11e353610be0ab:646
Spark.isolate/<@http://localhost:3000/packages/spark.js?3a050592ceb34d6c585c70f1df11e353610be0ab:925
._compute@http://localhost:3000/packages/deps.js?5ac28feec1f3e0539889ecde598dd9d01e408b41:163
._recompute@http://localhost:3000/packages/deps.js?5ac28feec1f3e0539889ecde598dd9d01e408b41:176
.flush@http://localhost:3000/packages/deps.js?5ac28feec1f3e0539889ecde598dd9d01e408b41:258
@MMore
Copy link

MMore commented Feb 24, 2014

Have you found the reason for this exception?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment