LoginSignup
1
0

More than 5 years have passed since last update.

rails db:seed

Last updated at Posted at 2017-02-24

cd ~/projects
git clone -b volume03 git://github.com/.../aaa.git pp
git -b :volume03ブランチ を指定
git 指定なし :masterブランチ を指定

pp :ディレクトリ名

rails db:setup
データベース初期化
rails db:seed シードファイルの実行

seed.rb
coding: utf-8
#articlesテーブルにデータ投入
Article.create(
 :url => 'Script',
 :title => 'Script', category => 'Script',
 :published => 'Script', :access => 'Script', :closed 'Script')

rails db:setup データベースの作成、スキーマ構築、初期データ投入

rails s
http://localhost:3000 

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