Rails3のコマンド


昨日の続き


参考:Rails3 リリースノート全文和訳 (ただし適当) - gom68の日記
参考:#200 Rails 3 Beta and RVM - RailsCasts

scaffold作成

コマンド変わっている
ってか"ruby script/***""rails ***"にすれば良いです。

rails generate scaffold todo title:string memo:text fixed:boolean

もしくは

rails g scaffold todo title:string memo:text fixed:boolean


削除

rails destroy scaffold todo

その他、コントローラとかモデルとかマイグレーションファイル作成

rails generate controller welcome index

rails generate model blog title:string text:text

rails generate migration AddFixedToBlogs fixed:boolean

migrate

変更なし

rake db:migrate

サーバ起動

rails server

もしくは

rails s


オプション

-p, --port=port Runs Rails on the specified port.
Default:
-b, --binding=ip Binds Rails to the specified ip.
Default:
-c, --config=file Use custom rackup configuration file
-d, --daemon Make server run as a Daemon.
-u, --debugger Enable ruby-debugging for the server.
-e, --environment=name Specifies the environment to run this server under (test/development/production).
Default:

-h, --help Show this help message.

サーバ起動のオプション変わってないかなー。

コンソール

rails console

もしくは

rails c

irb(main):001:0> t = Todo.new
=> #
irb(main):002:0> t.save
=> true

まぁ、変わらんね。

プラグインインストール

rails plugin install プラグイン

とりあえず、こんな感じ。