gtiwari333
gtiwari333

Reputation: 25156

grails dynamic scaffolding - skip a field to render in view

Is there any way to make some fields of a domain invisible in dynamic scaffolding view?

Upvotes: 2

Views: 1132

Answers (2)

cdeszaq
cdeszaq

Reputation: 31280

Another option would be to use the Fields plugin and override the notToDisplay field with an empty template so that it doesn't get displayed. This is a bit cleaner, since it doesn't pollute your domain layer with view-specific stuff.

Upvotes: 1

gtiwari333
gtiwari333

Reputation: 25156

I found it myself:

We can use the display constraint to achieve this.

source : http://grails.org/doc/latest/ref/Constraints/Usage.html

class {
    String notToDisplay
    ...

    static constraints = {
        ...
        notToDisplay(display:false)
    }
}

Upvotes: 9

Related Questions