examples:builder:belongsto_relation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
examples:builder:belongsto_relation [2021/03/28 21:53]
pdsci-admin [Step 7: Add related fields to form and list]
examples:builder:belongsto_relation [2021/04/11 19:27] (current)
pdsci-admin [The belongsTo relation]
Line 9: Line 9:
   * Required: a //**parent** table// and a //**child** table//    * Required: a //**parent** table// and a //**child** table// 
   * Create a model for the child table with list and form   * Create a model for the child table with list and form
-  * Add a field named: //[childModelName]// **to the parent table**+  * Add a field named: //[childModelName]_id// **to the parent table**
   * Extend **the parent controller** with relation behaviour   * Extend **the parent controller** with relation behaviour
   * Extend **the parent model** with the desired relation definition (//hasOne//)   * Extend **the parent model** with the desired relation definition (//hasOne//)