Sign up for my newsletter

Let's learn to become better developers.

How to Check If Value Exists in an Array in Ruby (and Rails)

In this post, we'll learn two different ways to check if a value is included in an Array.

January 05, 2023

Tracking TODO and FIXME Comments with Rails Notes Command

This post shows how you can use the notes command in Rails to search through your codebase for comments starting with a specific keyword. By default, it searches the codebase for FIXME, OPTIMIZE, and TODO comments, but you can also configure it to use custom keywords.

January 03, 2023

Tracking TODO and FIXME Comments with Rails Notes Command

What Happens When You Call render? Let's Understand the Rails Rendering Process

This article explains the Rails rendering process in the context of returning JSON data from the controller. Hopefully, it will make it clear what really happens when you call the render method from the controller.

December 29, 2022

Regular Expressions in Ruby

Regular expressions can be both terribly awkward and extremely useful. In this introductory post, we will learn the basics of regular expressions in Ruby programming language and how to use them for routine programming tasks.

December 26, 2022

Let's Learn Ruby on Rails + Hotwire by Building a To-Do List

In this article, we'll learn Ruby on Rails and Hotwire by building a to-do list from scratch. It shows how to build single-page web applications using traditional web architecture (server-rendered HTML), without the complexity of modern JavaScript frameworks like React.

December 11, 2022

Let's Learn Ruby on Rails + Hotwire by Building a To-Do List

How to Undo Generate Scaffold Command in Rails

Rails offers the convenient `rails destroy` command to undo the effects of any `rails generate` command. Also, don't forget to rollback the migration, if you have already applied it.

November 13, 2022

How to Undo Generate Scaffold Command in Rails

How self Keyword Works in Ruby

Ruby's self keyword can be pretty confusing to understand, especially if you're new to Ruby. Not understanding it often leads to subtle programming bugs that can be difficult to debug. This post explains how it works under common, everyday situations.

November 04, 2022

How self Keyword Works in Ruby

Setting Up Development Environment for Rails

This is the second article in the series on building awesome web applications with Ruby on Rails. It shows how to set up a kick-ass development environment for building Rails apps.

October 18, 2022

Setting Up Development Environment for Rails

Define Custom Routes Using the Member and Collection Blocks in Rails

Let's say you want to add non-resourceful custom routes on your controller. Most often, you're better off by introducing a new resourceful controller. However, in those cases where you absolutely have to, you can define new routes using the member and collection blocks provided by the Rails router.

October 15, 2022

Define Custom Routes Using the Member and Collection Blocks in Rails

How &:method Shortcut Works in Ruby

This post shows you how Ruby's `&:method` shortcut works behind the scenes. It's a clever trick that was added first in ActiveSupport and became an official feature in Ruby 1.8.7.

October 13, 2022

How &:method Shortcut Works in Ruby