Windows上の RailsInsaller を利用してみた。
▽scaffoldの実行
C:\Sites\ajaxsample\script>rails generate scaffold test name:string invoke active_record create db/migrate/20120914020008_create_tests.rb create app/models/test.rb invoke test_unit create test/unit/test_test.rb create test/fixtures/tests.yml route resources :tests invoke scaffold_controller create app/controllers/tests_controller.rb invoke erb create app/views/tests create app/views/tests/index.html.erb create app/views/tests/edit.html.erb create app/views/tests/show.html.erb create app/views/tests/new.html.erb create app/views/tests/_form.html.erb invoke test_unit create test/functional/tests_controller_test.rb invoke helper create app/helpers/tests_helper.rb invoke test_unit create test/unit/helpers/tests_helper_test.rb invoke assets invoke coffee create app/assets/javascripts/tests.js.coffee invoke scss create app/assets/stylesheets/tests.css.scss invoke scss identical app/assets/stylesheets/scaffolds.css.scssこれでコントローラーを含めた必要なファイル一式を作成してもらえる。
▽DBマイグレーションの実行
C:\Sites\ajaxsample\script>rake db:migrate (in C:/Sites/ajaxsample) == CreateTests: migrating ==================================================== -- create_table(:tests) -> 0.0940s == CreateTests: migrated (0.0960s) ===========================================▽初期状態の表示の確認
http://localhost:3000/tests
▽サンプルデータの作成
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html one: name: XXYYZZ▽サンプルデータの登録
C:\Sites\ajaxsample\script>rake db:fixtures:load (in C:/Sites/ajaxsample)▽サンプルデータの表示の確認
http://localhost:3000/tests
今回はここまで。