Grails does not do scaffolding for arrays. The hasMany is designed to be used with another domain class, not a variable. Using hasMany with a domain class will generate automatic scaffolding. For example
class Customer {
String name;
static hasMany = [ aliases:Alias ]
static constraints = {
name blank:false
}
}
class Alias {
String alias;
static constraints = {
alias blank:false
}
}
This would create two tables, customer and alias. A foreign key would be used to associate records in the alias table with a customer. The collection of aliases would be accessed by
alias[0].alias
If you have to use an array instead of another domain class you will have to write custom code for the user interface.