[Rails] Four Days on Rails

John McCreesh jpmcc at users.sourceforge.net
Tue Mar 1 19:21:32 GMT 2005


James Knight wrote:
> Hi John,
> 
> Thanks for writing this tutorial - it looks exactly what I need.
>
> However, I'm having problems setting it up, and wonder whether I'm 
> missing something obvious.
> 
> Page 9 - adding the model and scaffold lines to the 
> categories_controller. Hold on, shouldn't that be category_controller? 
> At least, that's what's created when I run "ruby script/generate 
> controller category"

Thanks - there were a number of errors in the early editions, which 
thanks to great feedback have been corrected in the latest version.

> Anyway, when I add the scaffold and test it in a browser, I get this error:
>  ActiveRecord::StatementInvalid in Category#index
> 
> Invalid argument: SELECT * FROM categories
> 
> When I run that select in mysql it runs fine, although there's not yet 
> any content in there, so it returns an empty set.
> 
> Surely this shouldn't be an invalid statement.

No, it should work ok. Pull yourself down a new copy of the .pdf from 
http://rails.homelinux.org. You can now also download the sample 
application too. I've moved these two files to another hoster as the 
number of downloads was swamping my server here, so apologies to anyone 
inconvenienced by slow downloads.

John


More information about the Rails mailing list