Rails Companion
Learn to Build a Web Application in Ruby, without Rails
In this course, we'll build a simple but complete app in plain Ruby without Rails, to get a deeper understanding and appreciation of everything Rails does for us. Finally, we will deploy it to a web server, which will give you a good understanding of the deployment process for Ruby-based web applications, including Rails.
Table of Contents
57 chapters- 1 Introduction
- 2 Setup Project Directory
- 3 Install Puma App Server
- 4 Install the Rack Gem
- 5 Create a Web Application
- 6 Make Puma Talk to Our App
- 7 Run the Application
- 8 Reload App when the Code Changes
- 9 Introduction to Rack
- 10 The Rack Protocol
- 11 The Rack Gem
- 12 Middleware Toolbox
- 13 Tools to Build Rack Apps + Middleware
- 14 The Rackup Command
- 15 Convenient DSL
- 16 What's Next?
- 17 Introduction to Router
- 18 What's a Router?
- 19 Current Setup
- 20 The Router Class
- 21 Using the Router
- 22 Step 1: Refactor the Router
- 23 Step 2: Create the Routes
- 24 Step 3: Update the App to Use New Routes
- 25 Pass HTTP Environment (Request to Routes)
- 26 Introduction to Controllers
- 27 What We'll Build
- 28 Step 1: Create a Controller Class
- 29 Step 2: Update the Router
- 30 Step 3: Add the Route
- 31 Refactoring: Extract Constructor to Base Controller
- 32 Serving Static Files
- 33 Separate View from Application
- 34 Make it Pretty with CSS
- 35 Serve Static Files via Middleware
- 36 Dynamic Views
- 37 Understanding the Concept of Binding
- 38 Using ERB with Binding
- 39 Step 1: Add a Render Method on Controller
- 40 Step 2: Render from Router
- 41 Create a View Template
- 42 Implement Logging
- 43 Logging in Ruby
- 44 Logging to a Log File
- 45 Log Levels
- 46 Log File Rotation
- 47 Adding Logging to Our Ruby App
- 48 Why Use Models?
- 49 Let's Add Models
- 50 Introduction to Zeitwerk
- 51 Using Zeitwerk to Load Constants
- 52 How Rails Configures Zeitwerk
- 53 Understanding the Concept of a Middleware
- 54 What is Middlware?
- 55 Why Use Middlware?
- 56 Let's Add Custom Middleware in Rails
- 57 Extract Logging Middleware