遇到的scaffold问题?还请高手帮忙解决?

遇到的scaffold问题?还请高手帮忙解决?

在学习ruby on php?name=rails" onclick="tagshow(event)" class="t_tag">rails中,我遇到很多scaffold问题,不知道怎么解决,还请高手帮忙?
NoMethodError in AdminController#index
undefined method `scaffold' for AdminController:Class
RAILS_ROOT: C:/Documents and Settings/Administrator/work/depot

Application Trace | Framework Trace | Full Trace

代码:
class CreateProducts < ActiveRecord::Migration
 def self.up
  create_table :products do |t|
      t.column :title,   :string
      t.column :description, :text
      t.column :image_url, :string

  
  end
 end

 def self.down
  drop_table :products
 end
end
controller中代码:
class AdminController < ApplicationController
scaffold :product
end
好像在rails 2.0版本中已经没有 scaffold了
可以参考http://www.ruby-lang.org.cn/foru ... ;highlight=scaffold
scaffold is no longer supported in rails2.0.2
If you really want to build the Depot project. I strongly recommend you to change back to Rails1.2.6

Do following:
1. typed "gem uninstall rails" at the rails command line
2. typed "gem install rails --version 1.2.6 --include-dependencies"
at the rails command line
3. delete or rename the original depot folder
4. do the following to quickly get back to where you were when the
error hit you:
D:\Rails\rails_apps\work>rails depot
cd depot
D:\Rails\rails_apps\work\depot>ruby script/generate model product
edit D:\Rails\rails_apps\work\depot\db\migrate\001_create_products.rb
   add
  t.column :title,  :string
  t.column :text,   :text
  t.column :image_url, :string
rake db:migrate
ruby script/generate controller admin
edit D:\Rails\rails_apps\work\depot\app\controllers
\admin_controller.rb
   add
  scaffold  :product

(change D:\Rails to where you installed rails, obviously)

Thanks
rails 2.0 脚手架创建方式改变了,改为 ruby script/generate scaffold ModelName [field:type, field:type]
模型名后面直接加上字段和字段类型。注意:中间不用加逗号,中括号也不用加。