I decided to spend some of my Christmas break taking a look at Ruby on Rails again and trying to get an application together under this application stack. Since I last looked at Rails, it had crossed the 1.x to 2.x version marker and several changes manifested. For someone trying to follow the 1.x tutorials or the canonical reference book Agile Web Development With Rails, one doesn’t make very much progress before the changes with respect to scaffolding bite one. One may need a bit of a tutorial on Rails 2.x scaffolding before being “pretty close” to training documentation. An excellent tutorial for this content was found at [Fairleads][fl].
Yet as I followed this through, I found myself stymied by the same error reported by “James”
Thanks now I easily understand how scaffolding changed in 2.0.
But I still have a problem when I followed the tutorial everything went fine but i am not presented with any sort of fields to enter information.
And when i add stuff to the database by hand and I list from within the scaffold I am not getting the information that is entered into the database I am just getting a blank entry.
At first I thought my problem was that I was trying to use a PostgreSQL back end, or perhaps it was because I was using MySQL, etc. But nevertheless I still ran into the same problem no matter which db back-end I used.
I then found another tutorial at [SapphireSteel][ss]. Curiously, this worked ( the db back end was sqlite3 ). This tutorial is meant to show off the Sapphire Steel product, but Huw, the author, has added, graciously, a “here’s what Rails is doing on the back end” translation for each step that his product automates.
With these data points my working hypothesis was this:
- Use SQLite3
- Follow Huw’s instructions, which use a more specialized invocation of “script/generate scaffold” ( control )
Duplicate these instructions using a more primitive invocation of “script-generate scaffold” that’s more familiar ( experiment )