Scaffold fuction not working properly

Are you using Rails 2.0?

If so, provide your scaffold with your model's definition, liike this:
ruby script\generate scaffold Product code:integer name:string

Make sure your you destroy your model first.

I posted something related to this here:
http://leonardoborges.com/writings/2007/12/21/rails-20-scaffold/

Hope it helps

My assumption is that the original poster is trying to follow the Agile Web Development with Rails book which is not compatible with Rails 2.0

My suggestion is to uninstall Rails

gem uninstall rails

then reinstall the specific version that will work with that book

gem install version=1.2.6 rails

Then, recreate the depot application

rails depot

That will allow you to complete the book, afterwhich you can upgrade to Rails 2.0.

Ack… mistake in my commands.

To install Rails 1.2.6, you should do

gem install --version=1.2.6 rails - I forgot the two –

Brian Hogan wrote:

My assumption is that the original poster is trying to follow the Agile
Web
Development with Rails book which is not compatible with Rails 2.0

My suggestion is to uninstall Rails

gem uninstall rails

then reinstall the specific version that will work with that book

gem install version=1.2.6 rails

Then, recreate the depot application

rails depot

That will allow you to complete the book, afterwhich you can upgrade to
Rails 2.0.

I trying to follow the AWDWR 2nd Edition book and I've seen your
suggestion in other place too. I can't see the point though, what is the
point on learning an obsolete version of rails when the new one is
obviously so different! Does anybody know how to work around this
problem with Rails 2.x?

The new version of Rails isn't actually so different from what I can
see - although i'm still learning also, so I'm open to correction
there...

what the scaffold does now is to generate the view, controller, and
model all in one... it also generates a database migration file (in
the db folder) which can be edited before performing a rake db:migrate
to create the database table with relevant fields... it's not really
too complex...