GAURAV VARMA
Rails 8 makes it official: every new Rails app is now a Progressive Web App by default — complete with a manifest.json
, service worker, and hooks for web push notifications via the upcoming Action Notifier framework.
This means Rails apps can now be installable, work offline, and send native-like push messages — without extra setup.
Why PWAs matter
PWAs bridge the gap between web and native apps:
- Installable like a mobile app
- Launch without browser chrome
- Offline-capable
- Support for push notifications
Especially for B2C apps, being installable and having push capabilities can be make-or-break. With Rails 8, these features come out of the box.
What's included in Rails 8
Rails 8 now scaffolds:
manifest.json.erb
: Defines the app name, icons, display behavior, and metadataservice-worker.js
: Registered automatically to enable offline caching and push- Action Notifier (coming soon): A new framework to send push notifications
A recent Rails PR (#50528) added default PWA setup to every new app.
Enabling the manifest
To make your Rails app installable on mobile:
- Add
<link rel="manifest" href="/manifest.json">
to your layout - Ensure your manifest is served at
/manifest.json
- Add platform-specific icons:
1<link rel="icon" href="/logo.png" type="image/png"> 2<link rel="apple-touch-icon" href="/logo.png">
Your app now prompts install in Chrome, Safari, Edge, and more.
Sample manifest:
1{
2 "name": "My Rails App",
3 "short_name": "RailsApp",
4 "start_url": "/",
5 "display": "standalone",
6 "theme_color": "#f43f5e",
7 "background_color": "#f43f5e",
8 "icons": [{ "src": "/logo.png", "sizes": "512x512", "type": "image/png" }]
9}
Service worker basics
Rails 8 adds an empty service worker scaffold to get you started:
1// app/javascript/application.js
2if ('serviceWorker' in navigator) {
3 navigator.serviceWorker.register('/service-worker.js');
4}
1// app/views/pwa/service-worker.js
2self.addEventListener('install', () => console.log('Service Worker installed'));
3self.addEventListener('activate', () =>
4 console.log('Service Worker activated'),
5);
You can extend it to handle caching and push notifications as needed.
Push Notifications (coming soon)
The upcoming Action Notifier framework will power native-style push notifications with support for:
- Subscription handling
- VAPID keys
- Background delivery
This complements the service worker, making it easy to notify users even when they’re not actively using the app.
Resources
Summary
Rails 8 is now PWA-ready by default, removing all friction for developers who want modern app-like experiences.
You get:
manifest.json
and install prompts- Service workers out of the box
- Hooks for push via Action Notifier
Whether you're building for mobile users, aiming for offline-first performance, or looking to boost engagement — Rails 8 sets the foundation right.