0
0

More than 3 years have passed since last update.

rails 新規アプリケーション立ち上げコマンド

Posted at

Ruby on Railsでの新規アプリケーション立ち上げ方法

自分に向けて記憶の範囲内だけでアウトプットします!

ターミナル
rails _6.0.0_ new test -d mysql

ターミナル
rails db:create

ターミナル
rails g model test

db/migrate/2020・・・・・
t.string :name, null: false (ここの行の記述は適当)

ターミナル
rails db:migrate

config/routes.rb
root to tests#index (ここの行も適当)

ターミナル
rails g controller tests

app/controller/tests.controller.rb
def index
  @tests = Test.all
end

database.yml
utf8○○・・・の箇所をutf8のみにする

app/views/index.html.erb
ここにHTMLを記述する

以上!

ここまで全て記憶内で書いてみました。足りないところや間違っているところもあると思いますが、私自身は間違っているところがあればエラー見ればわかるのでこれを参考にする方は100%信じきらないでください!

現場からは以上です!

0
0
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
0
0