Now updated with Strada, Rails 7.2, and Turbo 8!

Develop multi-platform apps using Ruby on Rails and Hotwire.

In 2024, building an app solely for web doesn't cut it any more. iOS and Android apps are essential for a successful SaaS product.

Using Rails and Hotwire, it's possible to build a web app with accompanying hybrid mobile apps that don't suck.

This book will teach you the skills to push Rails and Hotwire to the max.

Buy now for $99

Join the mailing list

You'll learn...

How to build an app for Web, iOS, and Android
We'll build a neighborhood marketplace app à la Gumtree or Craigslist. We'll call it Piazza. Alongside the Rails app, we'll also build iOS and Android apps using Turbo Native.
Authentication and Authorization from scratch
These are core concepts used in every single web app, and having a working understanding of what goes on under the hood is essential. That's why, in this book, we build them from scratch instead of using a gem.
Shipping production quality code
Far too many tutorials come with a caveat of "but don’t do this in production". They rarely explain what one should do in production. None of that nonsense. Everything in this book is 100% production ready!
Internationalization and Localization
Internationalizing an app from the get-go keeps all the user facing text out of the views. This keeps the code clean, makes it easier to test, and the app is ready to be localized when required.
Every single Rails sub-framework
Action Mailer, Active Storage, Action Text, Active Job, Action Cable, Action Mailbox. We'll build features using them all!
PostgreSQL powered search
It's hard to imagine a modern web app without search. PostgreSQL packs in quite a punch with its full-text search feature. We'll build a search engine using it.
Deploying the app to Render
Heroku is frozen in time. Render is the future. We'll deploy services to run Rails, Sidekiq, PostgreSQL and Redis.

Table of contents

Take a peek inside Hide
1. Getting Started

We’ll be building a marketplace app called Piazza in this book. We’ll set up the Rails, iOS and Android apps for it. We’ll also push them to GitHub and configure hosting on Render.com.

2. What is Hotwire?

A whistle-stop tour of Turbo, Turbo Native, and Stimulus. We’ll cover what they are and how to use them. Strada will be added when it’s released.

3. Users and sign ups

We’ll lay the foundation of Piazza by creating Users and Organizations. Along with the models, we’ll build views and controllers to allow users to sign up.

4. Authentication and navigation

Following on from the sign up flow, we’ll build an authentication system from scratch to securely identify the user behind every request. We’ll also build the navigation backbone of the app.

5. System tests, debugging, and Turbo

System tests allow us to simulate the actions of a user. We’ll cover the functionality build so far with system tests. Additionally, we’ll explore the use of Turbo Frames and how to debug Rails apps.

6. The native skeleton

We’ll bring the functionality so far to the native apps. This involves laying the substructure around Turbo Native. We’ll build a tabbed interface on both iOS and Android and look at how Turbo Native works under the hood.

7. Web powered native components

Using Strada, we can build native components powered by the web app. We’ll explore how Strada works and use it to build a fully native toolbar menu in the iOS and Android apps.

8. Password reset

Action Mailer makes it easy to send emails from a Rails app. We’ll use SendGrid as the production SMTP server and build a system allowing users to reset their password via email.

9. Creating ads

We’ll build Piazza’s core functionality to list ads on the platform. In this process, we’ll cover several advanced features in Rails such as nested forms, polymorphic associations, and database arrays. Pagination will be covered for the home feed. In the native apps, we’ll build a Turbo Frame powered infinite scrolling feed.

10. File upload and rich text

Building on top of the functionality in the previous chapter, we’ll enable file uploads and rich text descriptions in an ad. These will be powered by Active Storage and Action Text. We’ll also take a peek under the hood of both these frameworks.

11. Breadcrumbs, drafts, and saved ads

Breadcrumbs make navigation easier in web apps. We’ll build a simple mechanism for this from scratch. We’ll also allow the user to create draft ads and save ads to view later.

12. Authorization and custom error pages

Authorization complements authentication to determine which actions a user is allowed to perform. We’ll build a simple system for this. We’ll also replace the boring default error pages with snazzier ones rendered from within the Rails stack.

13. Background jobs

Rails has a built-in interface for background jobs called Active Job. We’ll use Sidekiq as the executor and build a job to expire an ad 30 days after it’s published. We’ll also use a plugin called Sidekiq Cron to clear unattached Active Storage blobs at regular intervals.

14. Search

PostgreSQL’s full-text search packs in one hell of a punch. We’ll explore how it works, how to create the relevant indexes, and how to construct search SQL queries using Arel.

15. The messaging system

We’ll build the mechanism for a buyer to contact a seller in Piazza. For real-time message delivery, we’ll use Action Cable. Other topics covered include Turbo Frame powered modals, custom Turbo Stream actions, and Action View request variants.

16. Internal messaging meets email

Using Kredis, we’ll detect whether a user is online when they receive a message. If they’re offline, we’ll send them an email notification to which they can reply. We’ll process the incoming reply using Action Mailbox.

Buy now for $99
I keep coming back to this book time and time again when something in production bites me in the rear. Thanks for such an amazing and fresh book.
—   Raphael Caldas
The Rails and Hotwire Codex picks up where the Handbook left off, exploring advanced tutorials and practical techniques. I recommend it to both newcomers and experienced developers for Rails.
—   Philip I. Thomas

Co-Founder, Find.AI

I am very impressed with this book. I don't think anything quite like it exists... There are a number of good Rails books out there, but this is absolutely amongst the top ones I have come across.
—   Thomas Keller
This book is definitely something that will help you level up with Rails and Hotwire. It's far more than just how to build a marketplace. It will help you better comprehend thus making you a better developer overall.
—   Stephen Swann

Founder, Overdue

I was blown away when I saw a tutorial on setting up an Android/iOS app was included. Really nice. Normally I avoid buying $99 ebooks as they are a waste of money, but, as a Ruby dev working on API-only Rails for 5+ years, this is exactly what I wanted to get up to speed.
—   Andrei Maxim
The book is outstanding, the best I've seen so far (in a very noisy niche!). The iOS portion of this book, especially, is terrific. It has the perfect amount of detail for a Rubyist who isn't terribly familiar with Cocoa or Swift.
—   Dave Paola

Founder, SierraRails

What's in the box?

Ebook in PDF and EPUB
A comprehensive ebook spanning over 900 pages that packs in everything you need to level-up your Ruby on Rails skills. Exercises in every chapter help you practice the techniques covered in the prose.
Source code for all 3 apps
The source code for the completed application on all 3 platforms. Great to use as reference!

Join the mailing list.

No spam. Not now, not ever.

Just periodic updates about the book!

If you're still unsure whether this book is for you, download the first three chapters for free!

Blog posts.

These blog posts have been extracted and adapted from the book.

Common questions.

Who is this book for?
This book assumes basic familiarity with Ruby and Rails. If you've never used Rails, I recommend completing The Ruby on Rails Tutorial by Michael Hartl before working through this book.

While junior to mid-level Rails developers will get the most value out of this book, I believe every single Rails developer will learn something significant.
Do I need any experience in native app development?
No, we only skim the native world in this book and everything you need is covered. Although, any previous experience would be highly beneficial!
What if I'm not interested in building native apps?
You can skip the chapters and sections on the native apps, that's totally fine. You can also choose to build only the iOS or Android app if you wish.

The book's core is the web app. The native apps just build on top of that.
Do you offer international pricing?
Yes. Email me with the country you live in and I'll give you a discount based on World Bank's Purchasing Parity Power factor.
Anything else?
Email me ⟶ ayush@radioactivetoy.tech
Buy now for $99

About the Author.

Ayush Newatia is a freelance Web Developer specialising in Ruby on Rails and Hotwire. In a previous life, he worked as an iOS and Android developer and was involved with the development of hugely popular apps for companies such as Nike and Dyson.

He's on the core team of the Bridgetown open source project, and he also runs a privacy focused mailing list app called Scattergun.