動画もアップしようと思いますので、この記事に追加します。
内容的には、静的なページ追加、gitの使い方、ソースの整理(リファクタリング)、ERB(テンプレートライブラリをちょっと使う)等など。
Rails的には、静的なページ追加と、テンプレートライブラリの使い方がメインだったと思います。
4章もやりかけてるけど、まだ終われてない。
https://railstutorial.jp/chapters/static_pages?version=5.1#cha-static_pages
ERBは昔使ったことあるから、難易度は低めに感じた。
動画で入力したコマンドの履歴
rails --version
rails _5.2.2_ new sample_app
cd sample_app/
git init
git add -A
git commit -m "Initialize repository"
cat > README.md
git commit -am "Improve the README"
vi app/controllers/application_controller.rb
vi config/routes.rb
git commit -am "Add hello"
git checkout -b static-pages
rails generate controller StaticPages home help
cat app/views/static_pages/home.html.erb
cat app/views/static_pages/help.html.erb
cat test/controllers/static_pages_controller_test.rb
rails test
cat app/helpers/static_pages_helper.rb
git add -A
git commit -m "Add a Static Pages controller"
rails db:migrate
cat config/routes.rb
cat app/controllers/static_pages_controller.rb
cat > app/views/static_pages/home.html.erb
cat > app/views/static_pages/help.html.erb
cat test/controllers/static_pages_controller_test.rb
vi test/controllers/static_pages_controller_test.rb
rails test
vi config/routes.rb
rails test
vi app/controllers/static_pages_controller.rb
rails test
touch app/views/static_pages/about.html.erb
rails test
cat > app/views/static_pages/about.html.erb
rails test
cat app/views/layouts/application.html.erb
git commit -m "Add about page"
git add -A
git commit -m "Add about page2"
mv app/views/layouts/application.html.erb layout_file
vi test/controllers/static_pages_controller_test.rb
rails test
cat >
cat > app/views/static_pages/home.html.erb
rails test
cat > app/views/static_pages/help.html.erb
rails test
cat > app/views/static_pages/about.html.erb
rails test
git add -A
git commit -m "Add Titles"
cat > app/views/static_pages/home.html.erb
rails test
cat > app/views/static_pages/help.html.erb
rails test
cat > app/views/static_pages/about.html.erb
rails test
git add -A
git commit -m "Refactor 01"
mv layout_file app/views/layouts/application.html.erb
cat app/views/layouts/application.html.erb
cat > app/views/layouts/application.html.erb
cat > app/views/static_pages/home.html.erb
cat > app/views/static_pages/help.html.erb
cat > app/views/static_pages/about.html.erb
rails test
cat > app/views/static_pages/contact.html.erb
vi test/controllers/static_pages_controller_test.rb
vi config/routes.rb
vi app/controllers/static_pages_controller.rb
rails test
git add -A
git commit -m "Refactor 02"
vi config/routes.rb
vi test/controllers/static_pages_controller_test.rb
rails test
vi config/routes.rb
rails test
vi config/routes.rb
rails test
git add -A
git commit -m "Finish static pages"
cat ../sample_app | grep apt
grep atp ../sample_app
grep apt ../sample_app
ls ..
head ../sample_app
head ../sample_app.txt
tail ../sample_app.txt
sudo apt install ruby-minitest-reporters
sudo apt install ruby-guard
cat test/test_helper.rb
cat > test/test_helper.rb
rails test
bundle exec guard init
cat /home/youtube/Rails/Tutorial/sample_app/Guardfile
cat > /home/youtube/Rails/Tutorial/sample_app/Guardfile
cat /home/youtube/Rails/Tutorial/sample_app/Guardfile
cat .gitignore
vi .gitignore
tail ../sample_app.txt
git add -A
git commit -m "Complete advanced setup"