Git Product home page Git Product logo

Comments (8)

pledbrook avatar pledbrook commented on September 27, 2024

This is a breaking change with Grails 2.3. The list action no longer exists in the scaffolding. We will need to update the chapter and source code to use the index action instead.

from graina2.

tikeswar avatar tikeswar commented on September 27, 2024

Thank you, Peter. With your help above, and looking at the official "Scaffolding - Reference Documentation" at http://grails.org/doc/latest/guide/scaffolding.html (currently for the version 2.3.1), I think it works now.

I commented out the entire index method in the QuoteController.groovy class as follows, and it seems to work now (meaning, I am able to see the quote list which I was not able to see before).

//def index() { 
//redirect(action: "home")
//}

Thank you again for the quick feedback, it was very helpful (especially for a newbie like myself).

from graina2.

pledbrook avatar pledbrook commented on September 27, 2024

Glad it's working for you. I'd like to keep this open as a reminder that we need to update the QOTD app.

from graina2.

mairoo avatar mairoo commented on September 27, 2024

I see the index page, but I cannot see the list Larry, Chuck and Eric's quotes.

I inserted three record using "grails console", and it prints 3 when I command "print qotd.Quote.count()"

Interestingly I don't see the 3 results in scaffolding index(list) page.

What's wrong with my index page?

Grails 2.3.4

from graina2.

pledbrook avatar pledbrook commented on September 27, 2024

Have you switched to a persistent database? If not, any changes you make via the console UI will not have an effect on the running application.

from graina2.

mairoo avatar mairoo commented on September 27, 2024

Thank you for your response.

I changed my environment settings for development as follwos:

development {
    dataSource {
        dbCreate = "update" // one of 'create', 'create-drop', 'update', 'validate', ''
        url = "jdbc:h2:file:~/devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE"
    }
}

I believe that it's enough to use persistent database.

I see the results "grails console". I can retreive results using random() action method described in your book.

I cannot see the three records only when I access the index() page supported by "scaffolding".

It's quite weired.

I tried to import your qotd application provided in github. It doesn't seem to work with Grails 2.3.4.

Can I know which version I have to choose on the fly?

from graina2.

mairoo avatar mairoo commented on September 27, 2024

Hmm...

I found an answer here: http://www.grailsexample.net/instant-ui-dynamic-scaffolding/#comment-29334

However, it sees like a bug of Grails 2.3.4 because I have to pass the List even using "dynamic" scaffolding like:

def index() {
    [quoteInstanceList : Quote.list()]
}

I believe that some contents must be changed if your book's supposed to support the latest version of Grails.

Thank you.

from graina2.

pledbrook avatar pledbrook commented on September 27, 2024

The sample source code is now based on Grails 2.3.4. @nasiajai please check your code against that. You should not be overriding the index action in your controller.

from graina2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.