After running generate scaffold and pointing the browser, the data list appears correctly, the create new button works okay, but show, edit, delete give the following error: "Could not find Organization without an ID" running on ubuntu breezy with postgresql - data and everything else appears correct - any ideas?
What is your show-url? Is it: http://yourapp/organizations/show Or is the id included in the url: http://yourapp/organizations/show/1 It should be like the latter url. That might be your problem. -- Posted via http://www.ruby-forum.com/.
The links on the list output only show the action, not the index value. But when I tried "../show/1" - I get an error about the id field not found. The organization table has a primary key called "organization_id" - Does Rails require the primary key to be named only "id" ? btw I''m running Ruby 1.8.3 and Rails 1.0. Jules wrote:> What is your show-url? Is it: > > http://yourapp/organizations/show > > Or is the id included in the url: > > http://yourapp/organizations/show/1 > > It should be like the latter url. > That might be your problem. >
Jules Jacobs
2006-Jan-09 18:34 UTC
[Rails] Re: Re: scaffold seems broken on show,edit,delete
Yes, Rails needs a primary key "id", and not "organization_id". (unless you override it in your model, but "id" is better) -- Posted via http://www.ruby-forum.com/.
John Taber
2006-Jan-09 21:13 UTC
[Rails] Re: Re: scaffold seems broken on show,edit,delete
Thanks - it works fine now. Missed this in the docs. Jules Jacobs wrote:> Yes, Rails needs a primary key "id", and not "organization_id". (unless > you override it in your model, but "id" is better) >