Note that there are some explanatory texts on larger screens.

plurals
  1. PO404 error with scaffolding in Grails
    primarykey
    data
    text
    <p>I was trying to follow the step-by-step instructions in Grails In Action (<a href="http://www.manning.com/gsmith2/GiA2E_meap_ch01.pdf" rel="nofollow">http://www.manning.com/gsmith2/GiA2E_meap_ch01.pdf</a>), and the scaffolding explained in section 1.5.1, Pg. 21-23 does not seem to be working for me.</p> <p>I added the <code>static scaffold = true</code> in the <code>QuoteController.groovy</code> as suggested. Then did <i>grails run-app</i>, and when I head to <code>localhost:8080/qotd/quote/<b>list</b></code> I get a 404 error (instead of the Figure 1.11 in the pdf) as follows:</p> <pre><code>HTTP Status 404 - /qotd/quote/list type Status report message /qotd/quote/list description The requested resource is not available. Apache Tomcat/7.0.42 </code></pre> <p>Here is the <code>QuoteController.groovy</code>:</p> <pre> package qotd class QuoteController { static scaffold = true def index() { redirect(action: "home") } def home() { render "Real Programmers do not eat Quiche" } def random() { def allQuotes = Quote.list() def randomQuote def n = allQuotes.size() if (n > 0){ def randomIdx = new Random().nextInt(n) randomQuote = allQuotes[randomIdx] } else{ String str = "Real Programmers Don't Eat Quiche" + n randomQuote = new Quote(author: "Anonymous", content: str) } [quote: randomQuote] } } </pre> <p>However, going to <code>localhost:8080/qotd/quote/<b>create</b></code> works fine (matches with Figure 1.12 in the pdf), and I am able to create a new quote.</p> <p><strong><em>The versions I am using are</em>:</strong><br> <strong>App version:</strong> 0.1<br> <strong>Grails version:</strong> 2.3.1<br> <strong>Groovy version:</strong> 2.1.8<br> <strong>JVM version:</strong> 1.7.0_45</p> <p>Is this a bug in Grails or I am missing something?</p> <p>I am new to Groovy and Grails, and any help would be highly appreciated. Thank you!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload