Ruby on Rails
Learn
Learn
- 為你自己學 Ruby on Rails, 2017-09
- Ruby on Rails Tutorial by Michael Hartl
Setup
Setup
Ruby Version Manager (RVM) for Rails Newbs, 2013-07
Model
Model
- 3 ActiveRecord Mistakes That Slow Down Rails Apps: Count, Where and Present, 2019
- 大批新增資料:Rails 6 bulk insert records
- Database Browser for SQLite
Views
Views
Layouts and Rendering in Rails
Controllers
Controllers
Rails Routing from the Outside In
實做範例
實做範例
- 自己對自己多對多: Rails Tutorial Chapter 11: Following users
- 使用 faker gem 產生測試用資料:Rails Tutorial 9.3.2 Sample Users
- 使用 Ajax: Rails Tutorial 11.2.5 A working follow button with Ajax
- SQL Subselect: Rails Tutorial 11.3.3 Subselects
Deploy
Deploy
Hosting
Hosting
Apache
Apache
Phusion Passenger users guide, Apache version
Console
Console
$ rails console --sandbox Loading development environment in sandbox Any modifications you make will be rolled back on exit >>
Rails Environment
Rails Environment
三種環境:test, development, production
$ rails console # 預設環境: development
# 在 test 環境執行 console
$ rails console test
# 指定 local Rails server 的環境
$ rails server --environment production
# 產生 production 環境的資料庫
$ bundle exec rake db:migrate RAILS_ENV=production
References
References
- code school: Code School teaches web technologies in the comfort of your browser with video lessons, coding challenges, and screencasts.
- Easy Does IT: Top 10 Gems For Rails Newbs, 2013-08
- Rails Casts