{{> afQuickField name="customer" options=customers }} // from addIntervention helpers
That’s it. The select(dropdown) list will generate since you map the field name on Customers collection.
Or if you want detailed explanation you may want to read the new awesome Meteor Guide, though, the relationship there is not explicitly say the term relationship, it has a different approach with the use of collection helpers.
Since, autopublish is not yet deactivated, you should see all the data from other collections.
I suggest try to deactivate autopublish and insecure and set up your publication and subscription.
Here’s how you do it:
/server/publication.js
Meteor.publish('customer', function(){ // 'customer' is the name of your publication
return Customers.find();
});
Meteor.publish('intervention', function(){ // same here 'intervention' is your publication name
return Interventions.find();
});
/client/add_intervention.js
Template.addIntervention.onCreated( function() {
this.subscribe('intervention'); // from intervention publication
this.subscribe('customer'); // from customer publication
});
Thanks for the Helper, this is a nice trick.
I thought I could set a relationship between my 2 schema and access properties like {{customer.name}}, {{customer.addresse.city}} etc. like here
The process describe there is not exactly a relationship, it’s the way you attach a schema from other collection, the output describe there is generating the input control from other schema not the data itself.
You can tinker a little bit to accomplish the way you want it, I too have issues, I’m far from a meteor expert.