|
在学习ruby on 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 |
|