Flowcharts & decision trees
This course teaches how to draw and read flowcharts and decision trees, and how they map to Ruby and Rails code. It covers the standard symbols, sequential and branching flows, guard clauses, and loops with break and next. Decision trees are used for pricing and authorization rules. Later lessons translate flowcharts into service objects, draw flowcharts from existing code, and use Mermaid in pull requests, state machines, migrations and Turbo flows.
What you'll learn
- ✓Flowchart symbols such as terminal, process, decision, I/O, connector and data store
- ✓Sequence, branch and loop patterns and their Ruby equivalents
- ✓Flattening nested branches with guard clauses and before_action
- ✓Building decision trees for shipping costs, discounts and authorization
- ✓Translating flowcharts into Ruby code and code back into flowcharts
- ✓Writing Mermaid diagrams for pull requests, state machines and migrations
What is a flowchart?
A flowchart is a visual diagram that represents a process as a sequence of steps connected by arrows. Each step is drawn as a shape, and the arrows show the flow: the order in which steps execute.
Read the full lesson free →Curriculum
7 lessonsWhat is a flowchart?
Introduces flowcharts, their four basic shapes, reading rules, and how a login flow matches Rails controller code.
Flowchart symbols and notation
Covers the wider ISO 5807 symbol set, arrow rules, merge points, and common notation mistakes with Ruby parallels.
Sequential and branching flows
Explains sequential and branching flows, nested decisions, and flattening them with guard clauses and Rails before_action callbacks.
Loops in flowcharts
Shows how while, until and each loops appear in flowcharts, plus break, next, infinite loops and nesting.
Decision trees: structured choices
Defines decision trees, compares them with flowcharts, and turns shipping and authorization trees into Ruby code.
From flowchart to code
Gives a step-by-step method for turning flowcharts into Ruby, with an order service example and common pitfalls.
Flowcharts in professional Rails development
Covers Mermaid syntax and flowcharts in pull requests, state machines, migrations, Turbo flows, and keeping diagrams current.