Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why dynamic scaffolding with Grails doesn't work proprely?

Tags:

grails

I've tried to scaffold dynamically some domains in GRAILS , but after adding items into database they doesn't show up in the listing view (User/index) in this case :

User.groovy

package scaffold_test

class User {

    String username
    String address
    static constraints = {
    }
}

UserController.groovy

package scaffold_test

class UserController {
        def scaffold=true
        def index() { }
    }

so after running the application, I can see the User controller in the Grails home page,I can add Users, and I can see the added instances via DbConsole. But i can't list the instances in the User/index view. Thanks !

like image 428
Guen_hamza Avatar asked Feb 27 '14 22:02

Guen_hamza


1 Answers

Delete def index() { } to let the scaffolding generate all of the methods.

like image 74
Burt Beckwith Avatar answered Oct 22 '22 12:10

Burt Beckwith