Scaffold問題

fireflyman 2009-08-08
我現在在看到書叫《Ruby on rails 電子商務實戰》,看到第三章.在第二章的時候,我創建了admin文件夾,在第三章處,我為數據庫架構添加了publishers表,并修改成下面形式
class CreatePublishers < ActiveRecord::Migration
  def self.up
    create_table:publishers do |table|
      table.column:name,:string,:limit=>255,:null=>false,:unique=>true
    end
  end
  

  def self.down
    drop_table:publishers
  end
end

然后執行遷移命令,rake db:migrate
隨后,我想用腳手架生成一些我需要的東西,命令如下-->
ruby script/generate scaffold Publisher 'admin/publisher'
執行后,出現下面字樣.發現應該要產生的一些publisher文件并沒有產生,如publisher_controller.rb和publisher_controller_test.rb
     
exists  app/models/
      exists  app/controllers/
      exists  app/helpers/
      create  app/views/publishers
      exists  app/views/layouts/
      exists  test/functional/
      exists  test/unit/
      create  app/views/publishers/i
wrong number of arguments (1 for 2)


請問我該怎么處理呢?
fireflyman 2009-08-21
http://xudayu.blog.51cto.com/187984/67326

還是自力更生好
sg552 2009-11-22
同意楼上。 还是直接看 Rails documentation 好。
getting started with rails:
http://guides.rubyonrails.org/getting_started.html

recommanded usage:

$ script/generate scaffold Post name:string title:string content:text




fireflyman 写道

Global site tag (gtag.js) - Google Analytics