Rails 2 - scaffold problem: ambiguous routes

servus in die Runde,

ich habe ein kleines Problem mit rails 2:

Nur zu Testzwecken erstelle ich ein neues Projekt:

rails testseite

Ich passe database.yml an und erstelle (weil ich es noch nicht
anders kann und weil ich faul bin) via:

script/generate scaffold news posted_by:string posted_at:datetime

title:string message:text

das entsprechende Gerüst. Nun migriere ich:

rake db:migrate

OK, schnell noch den Apachen neu starten - alles läuft über FastCGI.
Browser aufrufen, Adresse eingeben: OK, mit “Listing news” begrüßt
er mich und ich klicke auf “New news”:

Ergebnis:
news_url failed to generate from {:action=>“show”, :controller=>“news”}

  • you may have ambiguous routes, or you may need to supply additional
    parameters for this route. content_url has the following required
    parameters: [“news”, :id] - are they all satisfied?

Natürlich sind noch keine Parameter da: erst soll ja mal das Formular
angezeigt werden!, außerdem wurde news_url gerufen, nicht content_url.
Scheidet also aus, denke ich.

Das passiert auch, wenn ich Webrick anstatt Apache hernehme.
Webrick quittiert die Anfrage auf der Konsole mit Code 500.
(Internal Server Error, wenn ich nicht irre)

Die routes.rb enthält genau 3 aktive (also nicht kommentierte) Zeilen:

  1. map.resources :news
  2. map.connect ‘:controller/:action/:id’
  3. map.connect ‘:controller/:action/:id.:format’

Wobei [1.] vom scaffold-Aufruf eingefügt wird.

Eine/Einer eine Idee?
Ich nutze “ruby 1.8.6 (2007-09-24 patchlevel 111) [i486-linux]”
unter Debian/Lenny, rails 2.0.2

Danke und Gruß
Torsten

Torsten F. schrieb:

script/generate scaffold news posted_by:string posted_at:datetime

news_url failed to generate from {:action=>“show”, :controller=>“news”}
(Internal Server Error, wenn ich nicht irre)
unter Debian/Lenny, rails 2.0.2

Danke und Gruß
Torsten

Grund gefunden:
http://somethinglearned.com/articles/2007/03/19/how-to-uncountable-names-in-restful-routes

Torsten