This repository contains all code examples from the Rails Cookbook. Each example is tied to a recipe in the book and is organized by chapter and recipe number.
├── Chapter01
│ └── recipe-2
│ ├── begin
│ └── end
├── Chapter02
│ ├── recipe-5
│ ├── recipe-6
│ └── ...
├── Chapter03
│ └── recipe-8
├── ...
-
ChapterXX/recipe-N/
— Contains the source code for Recipe N in Chapter XX. -
Each
recipe-N
folder contains two subfolders:begin/
: Starting state before the recipe is appliedend/
: Final state after following the steps in the recipe
Each recipe folder also includes its own README.md
with setup instructions and comparison tips.
-
Clone the repository:
git clone https://github.com/PacktPublishing/Ruby-on-Rails-Web-development-cookbook.git cd rails-cookbook-code
-
Navigate to the recipe you want to try, for example:
cd Chapter02/recipe-6/begin
-
Follow the instructions in the local
README.md
file inside therecipe-N
folder to run the app.
Each recipe demonstrates the full change in code. To compare before/after:
diff -r begin/ end/
Or visually (if using VS Code):
code --diff begin end
Found an issue or have feedback? Please open an issue or send a pull request.
© [2025] [Rizwan Reza]. All rights reserved.