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を記述する