Reputation: 4065
Some of my domain classes represent static data and they are not allowed to be modified. How can I make sure at the UI level that grails automatically prevents users from modifying data.
In simple words, I need to create readonly views for some of my domain classes. Is it possible to mark a domain class as readonly?
Upvotes: 1
Views: 1243
Reputation: 525
There is a contraint that you can set on your properties for scaffolding to set them as readonly :
editable : Boolean that determines whether the property can be edited from the scaffolding views. If false, the associated form fields are displayed in read-only mode.
As per this link
Else you can generate the static scaffolding controller and views and remove the create/update/delete actions and view components.
Upvotes: 1