Tutorials
Running Migrations Once During a Multi-Host Kamal Deploy | t27duck
At my day job, we deploy our Rails app in production to three separate web hosts using Kamal. Each container runs bin/docker-entrypoint on startup, which runs bin/rails db:prepare. That worked fine when there was only one host (like staging), but ...
Inbound email in Rails apps with Fuik | Rails Designer
Fuik is a Rails engine for handling webhooks that I launched recently. But it can also be used to process inbound emails! đź’ˇ
When working with inbound email in Rails using Action Mailbox, there’s a key requirement: managing EML files and blob stor...
One year of Ruby on Rails configuration | Island94.org
I’ve been working professionaly with Ruby on Rails for nearly 15 years (I’m also the author of GoodJob and Spectator Sport). Last year I left GitHub and co-founded a technology startup, Frontdoor Benefits, that helps people enroll and manage their...
Reusable drag-and-drop image preview in Rails | Rails Designer
Build a copy-paste custom element for image uploads that works anywhere in your Rails app. Drag-and-drop, previews and form integration without any framework overhead.Custom elements have been covered here berfore. If you have used Hotwire in Rail...
Migrating from Sprockets to Propshaft in Rails 8 | Saeloun Blog
A step-by-step guide to migrate our Rails 7.1 app from Sprockets to Propshaft, covering Bootstrap, jQuery, Select2, and gems without npm packages.Rails 8 introduces a significant change to the asset pipeline by making Propshaft the default asset p...
Use class_names to Conditionally Apply CSS Classes - Andy Croll
Stop interpolating CSS classes with ternaries in your ERB templates.When you’re building views in Rails, you often need to apply CSS classes conditionally. Maybe a nav link should look different when it’s the current page, or a form field needs er...
kamal-backup: Scheduled Rails Backups for Kamal Apps
kamal-backup is two pieces: a Ruby gem you add to your Rails app, and a Docker image you boot as a Kamal accessory. They point at a restic repository you bring yourself.
The gem is your CLI. Local commands run directly on your machine using resti...
Avoid html_safe with Tag Helpers, safe_join, and sanitize - Andy Croll
Rails has better tools than html_safe for building HTML safely in your helpers and views.When you need to build HTML outside of a template, it’s tempting to concatenate strings and call html_safe on the result. This bypasses Rails’s built-in XSS p...