2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rails ことはじめ

Posted at

rails ことはじめ

rails チュートリアル

railsのプロジェクト作成

$ rails new {プロジェクト名}
$ rails new {プロジェクト名} -d mysql
$ rails new bundletest --skip-bundle

デフォはsqlite3

サーバー作成

$ sudo rails server

model生成

$ rails generate model {モデル名}
$ rails generate model {モデル名 フィールド名1:データ型1 ...}
$ rails generate scaffold {モデル名}
$ rails generate scaffold {モデル名 フィールド名1:データ型1 ...}

model削除

$ rails destroy model {モデル名}

controller生成

$ sudo rails controller {コントローラー名} {アクション名}   

経路の確認

$ sudo rake routes

データベース作成

$ rake db:create

データベースのマイグレーション

$ rake db:migrate

データベースへのデータ登録(db/seeds.rb)

$ rake db:seed

SQLite コマンドラインツール起動,終了

$ rails dbconsole
$ .quit
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?