2011-03-28 32 views

回答

2

可以重命名的所有文件(類),但破壞腳手架會更快:)

+0

但手工做這一切將是一個很好的學習經驗。 – 2011-03-28 21:12:27

+0

嘿,我覺得這樣:) – fl00r 2011-03-28 21:39:57

0

當你腳手架,將創建一個遷移。您可以遷移下來的版本回滾設置支架(如果你已經做了分貝:遷移):

./script/generate scaffold Set foo:string bar:string 
     exists app/models/ 
     exists app/controllers/ 
     exists app/helpers/ 
     create app/views/sets 
     exists app/views/layouts/ 
     exists test/functional/ 
     exists test/unit/ 
      create test/unit/helpers/ 
     exists public/stylesheets/ 
     create app/views/sets/index.html.erb 
     create app/views/sets/show.html.erb 
     create app/views/sets/new.html.erb 
     create app/views/sets/edit.html.erb 
     create app/views/layouts/sets.html.erb 
     create public/stylesheets/scaffold.css 
     create app/controllers/sets_controller.rb 
     create test/functional/sets_controller_test.rb 
     create app/helpers/sets_helper.rb 
     create test/unit/helpers/sets_helper_test.rb 
     route map.resources :sets 
    dependency model 
     exists app/models/ 
     exists test/unit/ 
     exists test/fixtures/ 
     create app/models/set.rb 
     create test/unit/set_test.rb 
     create test/fixtures/sets.yml 
     create db/migrate 
     create db/migrate/20110328204128_create_sets.rb 

要小心,以這條線:

 create db/migrate/20110328204128_create_sets.rb 

它提供了遷移的數量: 20110328204128

回滾事務:

rake db:migrate:down VERSION=20110328204128 

最後一步:

地板說:

可以重命名的所有文件(類),但破壞腳手架會更快:)