According to the docs, Grails provides a number of constraints that "have no impact on persistence but customize the scaffolding". One of them is the password
constraint. Here's how I use it:
class User {
String username
String password
static constraints = {
username blank: false
password blank: false, password: true
}
}
In combination with scaffolding, this has the effect that the edit view uses a specialized password input for my password field (that's fine), but the index and show view still show the password in plain text (not fine at all). Is there a way to have the password field only in the create and edit views, or at least masked with an asterisk or other character on the other views? Otherwise I wonder what the real benefit of this constraint might be. I tried specifying display: false, editable: true
as additional constraints, but to no avail.