Which one should I use aldeed/meteor-simple-schema or aldeed/simple-schema-js ?
I am having problems with custom validation messages.
aldeed/simple-schema-js
is recommended over the atmosphere version.
Can you give specifics on what issues you are having?
1 Like
I am using meteor/mdg:validated-method and I think it requires aldeed/meteor-simple-schema
but I am not sure.
Can you help me with this one please ?
I use aldeed:simple-schema together with mdg:validated-method.
I have a file for each one of my collections with the declaration of the collection and the schema declaration for that collection right underneath. I also found attaching the schema to the collection really handy.
export const Orders = new Mongo.Collection('orders');
Orders.schema = new SimpleSchema({ ... });
I wouldn’t attach your messages to the one schema, though, so other schema’s can also use them. I have a separate file that sets translated error messages for all schema’s like so:
SimpleSchema.messages({
required: TAPi18n.__('schema-validation.required'),
...
});
Hope this helps.
1 Like