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

Rajan Bhattarai

Full Stack Software Developer! πŸ’» 🏑 Grad. Student, MCS. πŸŽ“ Class of '23. GitKraken Ambassador πŸ‡³πŸ‡΅ 2021/22. Works with Ruby / Rails. Photography when no coding. Also tweets a lot at TW / @cdrrazan!

118 posts •
Ruby 3

Hash Methods Worth Knowing β€” transform_keys, transform_values, filter, and merge with a Block

Hashes are the workhorse data structure of most Ruby applications β€” API responses, configuration objects, parameters, aggregations. Ruby’s Hash class has been steadily gaining methods that reduce the boilerplate of common transformations. transform_keys,

Rajan Bhattarai Rajan Bhattarai 10 min read
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
Developer tips

How to Give Effective Code Reviews β€” The Reviewer's Craft

Code review is one of the highest-leverage activities a developer does. A good reviewer catches real problems before they reach production, helps less experienced engineers grow faster, and raises the quality bar for

Rajan Bhattarai Rajan Bhattarai 11 min read
Ruby-code

Transpose A 2d Array Matrix In Ruby

Flip a matrix over its diagonal β€” rows become columns and columns become rows. Ruby’s Array#transpose handles this in one call.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby-code

Memoize Expensive Method Calls In Ruby To Avoid Repeated Computation

When a method performs an expensive operation β€” a database query, an API call, a complex calculation β€” calling it repeatedly wastes time and resources. Memoization caches the result on first call and

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby-code

Deep Merge Nested Hashes In Ruby Without Losing Keys

Ruby’s built-in Hash#merge only merges the top level β€” nested keys get overwritten entirely instead of merged recursively. When working with deeply nested configuration objects or API payloads, you need a merge that

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby-code

Diff Two Hashes And Return Added Removed And Changed Keys In Ruby

When comparing configuration objects, API responses, or form submissions, you often need to know exactly what changed β€” not just whether the hashes are equal.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

filter_map and Modern Enumerable β€” Ruby's Most Useful Recent Additions

Ruby’s Enumerable module has been quietly gaining methods that make common collection operations more expressive without adding complexity. filter_map alone replaces a pattern that every Ruby developer has written dozens of times. Combined

Rajan Bhattarai Rajan Bhattarai 11 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
Page 1 of 14 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! πŸš€