[[TOC(heading=Scaffolds Section Contents, HowTos/HowToUseScaffolds*)]]
= Scaffolds: Adding Scaffolds =
To add a scaffold:
1. Add a table to your database. At present, it (and any tables it uses in relationships) may only have one column acting as a primary key. For the sake of example, we'll pretend we've added a table named "Contact"
1. If the table is related to other tables in a one-to-many or many-to-many manner, add those relationships to your ORM configuration. [wiki:HowTos/ORMIntegration/InstallingAnORM Installing an ORM in ModelGlue] [http://livedocs.reactorframework.com/Reactor_Documentation.htm#hasMany.htm Reactor's documentation]. [http://docs.transfer-orm.com/ Transfer's documentation].
1. Add the following tag to your !ModelGlue.xml:
{{{
}}}
By default, this will create the following event handlers:
1. Contact.List - Lists all contacts from the contact table
1. Contact.View - Displays a specific contact in a read-only manner
1. Contact.Edit - Provides a form to edit a contact
1. Contact.Commit - Saves a contact to the database
1. Contact.Delete - Deletes a given contact
== Using the (optional) EVENT-TYPE attribute ==
For a given scaffold tag, you may specify the list of event-types to apply to each event-handler tag created by the scaffold tag. This is especially useful for applying functionality such as security automatically to your generated event handlers.
{{{
}}}
Results in two event-handler's with their main tag like those below:
{{{
}}}