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 •
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

Rajan Bhattarai Rajan Bhattarai 8 min read
Developer tips

Networking for Introverted Developers โ€” Without Pretending to Be Someone You're Not

The word โ€œnetworkingโ€ was invented to make introverts miserable. It conjures images of badge-scanning at conference happy hours, small talk with strangers over lukewarm beer, and handing out business cards to people youโ€™ll

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby-code

Paginate An Array In Ruby Using Each_slice

When displaying large datasets in pages โ€” or processing records in batches โ€” you need to split an array into fixed-size chunks. Rubyโ€™s each_slice handles this cleanly without manual index arithmetic.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

method_missing and respond_to_missing? โ€” Ruby Metaprogramming That's Actually Useful

Metaprogramming has a reputation for being either magical or dangerous, depending on who you ask. Both reactions are earned. Rubyโ€™s method_missing hook lets you intercept calls to methods that donโ€™t exist and handle

Rajan Bhattarai Rajan Bhattarai 8 min read
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,

Rajan Bhattarai Rajan Bhattarai 8 min read
Developer tips

Why Every Developer Should Have a Personal Blog (And How to Actually Start)

The number of developers who should have a personal blog and donโ€™t is staggering. Not because they have nothing worth saying โ€” most of them have been solving interesting problems for years โ€”

Rajan Bhattarai Rajan Bhattarai 10 min read
Ruby-code

Count Word Frequency In A String In Ruby

Counting how often each word appears in a string is a common text-processing task โ€” useful for analytics, content analysis, keyword detection, and building word clouds. Rubyโ€™s Enumerable provides an idiomatic one-liner.

Rajan Bhattarai Rajan Bhattarai 1 min read
Ruby 3

tap, then, and yield_self โ€” Ruby's Method Chaining Toolkit

Ruby has three methods that look similar on the surface but solve distinct problems in method chains: tap, then (aliased as yield_self), and itself. Once you understand what each one is actually for,

Rajan Bhattarai Rajan Bhattarai 8 min read
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 โ€”

Rajan Bhattarai Rajan Bhattarai 8 min read
« Newer Posts Page 9 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! ๐Ÿš€