Ten Things You Didn't Know Rails Could Do
summary
Shows how to run a complete single-file Rails app and how migrations like `references`/`belongs_to` create the foreign key column, an index and the model association automatically. Demonstrates Postgres full‑text search using a tsvector + GIN index and trigger, the lightweight `pluck` and `group.count` database tricks, streaming CSV downloads with an Enumerator + `find_each`, background work via a thread-safe queue for async jobs, per-user separate SQLite databases switched by subdomain, and turning Rails into a static site by precompiling assets and page‑caching while spidering the app.
AI-written summary · about
chapters (36)
- 0:00Introduction
- 2:15Rails in a single file
- 3:41TODO comments & Rails console tricks
- 4:45Sandboxed console & helpers
- 5:27Switching web servers
- 6:07Plugins like Rails itself
- 7:10Shorthand migrations & indexes
- 7:51Automatic foreign keys
- 8:33Applied migrations check
- 8:53CSV data loading
- 9:38CSV serialization in DB
- 10:24Plucking & grouping fields
- 11:06Overriding associations
- 12:10ActiveRecord with IDs
- 12:52PostgreSQL string limits
- 13:56Full-text search
- 15:43Multi-db per user
- 18:15Why explore Rails
- 19:40Rails modifies Ruby
- 20:01Atomic file writing
- 21:05Deep merging hashes
- 21:47Reverse merging params
- 22:51String inquiry methods
- 23:54Rails on magazine covers
- 24:40ERB comments & tricks
- 25:46ERB percent syntax
- 26:52Clean view calculations
- 28:17Rendering arrays & partials
- 29:41Grouped select menus
- 30:22Custom form builders
- 32:47Routing exceptions
- 33:50Mounting Rack apps
- 34:55Sending CSV files
- 36:21Background threads
- 38:26Rails for static sites
- 40:34Closing remarks
related talks
42mPowerful Rails Features You Might Not Know
40mTricks That Rails Didn't Tell You About
43mThe Magic of Rails
24mThe Rails Features we Loved, Lost, and Laughed at
34mCode Spelunking: teach yourself how Rails works
38mRails on Ruby: How Ruby Makes Rails Great
26mDissecting Rails - a different approach to learning Rails
30mCrushing It With Rake Tasks
