Search code examples
grailsgroovyview

How can I generate the default views in grails?


Why is the default option of generete views disabled? How can I enable it to create my default views?

enter image description here


Solution

  • By default all views are generated at runtime using your controller configuration:

    class BookController {
        static scaffold = Book  // Or any other domain class name
    }
    

    If you want to generate views (files on disk) a command from the grails CLI in required:

    grails generate-views Book
    

    See the scaffolding documentation for more details.