Rails ActiveRecord Callbacks — When to Use Them and When to Stop ActiveRecord callbacks are one of Rails’s most convenient features and one of its most misused. before_save, after_create, after_commit — they let you hook into the model lifecycle and run code automatically, which sounds
Rails Rails API Mode — Building JSON APIs Without the Full Stack Overhead Rails started as a framework for server-rendered HTML applications, and it still excels there. But a significant portion of Rails apps today are pure JSON APIs — backends for mobile apps, frontend JavaScript
Rails Action Cable — Real-Time Features in Rails with WebSockets Turbo Streams handle real-time updates elegantly for most cases — server broadcasts a change, the page updates. But Turbo Streams build on top of Action Cable, and sometimes you need to work at
Rails Service Objects in Rails — Keeping Controllers Thin Without Losing Your Mind Fat models, skinny controllers was the mantra for years. Then models got fat and we realized that was wrong too. Business logic crammed into ActiveRecord models means models responsible for database persistence, validations,
Rails Turbo Frames — Partial Page Updates in Rails Without Writing JavaScript Turbo Streams handle real-time updates pushed from the server. Turbo Frames handle a different problem: replacing sections of a page in response to user interaction — clicking a link, submitting a form —
Rails Rails Credentials — Managing Secrets Without Leaking Them Every Rails app has secrets — API keys, database passwords, third-party service tokens. The bad old pattern was storing these in environment variables set manually on each server, or worse, hardcoded in config
Rails Action Mailer — Sending Emails in Rails Without the Headaches Email is one of those features every app eventually needs and nobody particularly wants to build. Welcome emails, password resets, weekly digests, transactional notifications — the list grows quickly once your app is
Rails Active Storage — File Uploads in Rails Without the Ceremony File uploads have a reputation for being one of those features that look simple and turn out to be a multi-day project. Pick a storage backend, configure credentials, handle direct uploads, generate variants,
Rails Stimulus.js — Adding Interactivity to Hotwire Without a Frontend Framework Turbo handles navigation and real-time updates beautifully — page transitions, stream updates, frame replacement, all without writing JavaScript. But there’s always that next layer of requirement: a dropdown that opens and closes, a
Rails Solid Queue — Background Jobs in Rails 8 Without Redis For years, the default answer to “how do I run background jobs in Rails?” has been: add Redis, add Sidekiq, configure two separate services, monitor two dashboards, and don’t forget to handle Redis
Rails Real-Time UI Updates with Turbo Streams in Rails 7 and 8 Real-time features used to mean reaching for ActionCable, writing JavaScript event listeners, and managing WebSocket state that lives entirely outside your Rails stack. Turbo Streams changed that equation entirely. Built into Rails 7
Rails Exploring the New Basic Authentication Generator in Rails 8 Rails 8 introduces a built-in authentication generator, streamlining the process of adding basic authentication to Rails applications.
Rails Optimizing N+1 Queries in Rails In the realm of Ruby on Rails development, the N+1 query problem is a notorious performance bottleneck.
Rails Security features in Rails 7 & 8 Ruby on Rails has long been recognized for its emphasis on security, offering developers a robust framework to build secure web applications.