FirstDEV blog
  • Home
  • Ruby
  • Ruby On Rails
  • Tips
  • Solutions
  • About
Subscribe

Rails

A collection of 29 posts

Rails

Rails Routing Deep Dive — Namespaces, Constraints, and Patterns Worth Knowing

Rails routing gets treated as the part you set up once and forget. For most CRUD resources, resources :posts and moving on is exactly right. But as applications grow, routing decisions start to

Rajan Bhattarai Rajan Bhattarai 9 min read
Rails

Turbo Streams — Real-Time Page Updates in Rails Without Writing JavaScript

Turbo Streams are the part of Hotwire that makes Rails feel genuinely modern for collaborative, real-time features. Where Turbo Frames handle navigation and scoped updates on the current user’s page, Turbo Streams broadcast

Rajan Bhattarai Rajan Bhattarai 10 min read
Rails

ActiveRecord Transactions and Locking — Keeping Data Consistent Under Concurrency

Database transactions are one of those topics where knowing the basics is easy, but knowing when the basics aren’t enough is harder. ActiveRecord::Base.transaction wraps database operations in an atomic block — either everything

Rajan Bhattarai Rajan Bhattarai 9 min read
Rails

Rails Concerns — When They Help, When They Hurt, and What to Use Instead

Concerns are one of Rails’ most polarizing features. On one hand, they’re built-in, well-supported, and solve the real problem of reusing code across models and controllers. On the other hand, a codebase full

Rajan Bhattarai Rajan Bhattarai 9 min read
Rails

Action Mailer in Rails — Production-Ready Email Without the Footguns

Email in Rails looks deceptively simple — generate a mailer, write a template, call deliver_later. The basics take ten minutes. The production footguns take longer to find: emails sent synchronously blocking requests, views

Rajan Bhattarai Rajan Bhattarai 8 min read
Rails

N+1 Queries in ActiveRecord — Diagnosis, Eager Loading, and When Preloading Backfires

N+1 queries are one of those problems that makes perfect sense once you understand them, and that silently degrades production performance until a request that touches 500 records starts taking four seconds. The

Rajan Bhattarai Rajan Bhattarai 10 min read
Rails

Active Storage — File Uploads and Attachments in Rails Without the Complexity

File uploads have a reputation for being the feature that always requires a gem, a CDN configuration, and half a day of setup. Active Storage, built into Rails 5.2+, changes that. It handles

Rajan Bhattarai Rajan Bhattarai 8 min read
Rails

Rails 8 Authentication Generator — Built-in Auth Without Devise

Authentication is one of those problems that sounds simple and isn’t. Devise has solved it for Rails developers for over a decade — but it’s also a dependency that ships with opinions, a

Rajan Bhattarai Rajan Bhattarai 8 min read
Rails

Stimulus Controllers — Adding JavaScript Behavior to Rails Views Without a SPA

The appeal of server-rendered Rails has always been that you write less — less duplication between client and server, less state management, less JavaScript infrastructure. But “less JavaScript” doesn’t mean no JavaScript. Dropdowns

Rajan Bhattarai Rajan Bhattarai 9 min read
Page 1 of 4 Older Posts »
FirstDEV blog © 2026
Proudly published with Jekyll & using Jasper2
Latest Posts Twitter
FirstDEV blog

Check viewARU - Brand Newsletter!

Newsletter to DEVs by DEVs - boost your Personal Brand & career! 🚀