Search code examples
grailsgrails-domain-classgrails-controller

Grails list view not working


I am trying out tutorials from this youtube link by Mike Kelly.

I completed all installations successfully. Now trying out dynamic scaffolding, but its list is not working.

This is how the show page looks like when I added a new EndUser:

enter image description here

Now when I try to see list of EndUsers, (see the pointing link at bottom-left corner of above image), the link actually points to index page. And when I click on it, it opens up index page with NO rows listed in table (see below image).

enter image description here

I also tried to access list by using url: http://localhost:9000/ProjectTracker/endUser/list, but then it resulted into 404 error:

enter image description here

When I saw the database console, i found the data got inserted in it:

enter image description here

(All files (controllers, domain files, etc.) are same as mentioned in the video tutorials)


Solution

  • This is for grails version 2.4.4 :

    As suggested by @DavidChavez we can write those index and list methods as given. Or simply relying on dynamic scaffolding, we can just ignore writing / remove index and list methods. The dynamic scaffolding will take care of calling index by default, which internally calls list method.