Forms
So far, our buttons and forms have been highly inefficient because they are not easy to repeat, and therefore, not easy to maintain. There are two ways that we can use to make our code easier to manage:
- Meteor Methods
- Autoform
With Meteor Methods, we can easily create repeatable and secure functions while autoforms can identify the structure of a collection and generate form elements from it. This provides a decent layer of security without much effort as well. Autoform and Meteor Methods can be used together as well for further security.
The autoform method can be implemented through the aldeed:autoform
and aldeed:collection2
packages.
Meteor Methods
Meteor Methods can be used on the client or the server. They are created by using the Meteor.methods(<object-of-functions>)
function and run with the Meteor.call(<function-name>, <callback function>)
function. Running a meteor method from the client causes 2 versions of the same function to run. One runs on the server and...