Sign up for my newsletter
Let's learn to become better developers.
How to Setup Tailwind 3 on Rails
Update: Tailwind documentation has since added the installation steps with Rails.
December 13, 2021
Couldn't Find Handler For: puma, thin, falcon, webrick
This morning, I was trying to learn Rack and how Rails uses it. So I created a new gem using the bundle gem command. Then I added a config.ru file with the following code.
December 09, 2021
All the Database Tasks in Rails
Once you start programming in Rails, you inevitably come across db:migrate, which applies the migration to your database. Then you make a mistake and learn about db:rollback to revert the previous migration.
December 08, 2021
How to Drop a Table in Rails
So you created a migration to add a table that you thought you were going to need. You also ran that migration so that table is in your database. Now, you don’t need it anymore and want to drop it from the database. How do you remove that table?
December 07, 2021
How to Test Rails Source Code
One of the best ways to understand any codebase is to read the tests, and Rails is no exception. In this post, we will learn “how to run the tests” included in the Rails codebase.
November 28, 2021
Include and Extend
Here’s a neat trick I learned today.
September 25, 2021
Modifying Objects in Place
Every time you create or copy something in memory, you add work for GC. Here are some tips from the book Ruby Performance Optimization to write code without using too much memory.
September 22, 2021
Class Metaprogramming in Ruby
A Ruby class definition is just regular code that runs. When you use the class keyword to create a class, you aren’t just dictating how objects will behave in the future. You are actually running code.
September 21, 2021
How to Implement Callbacks in Ruby
There are at least three places in Ruby where you can package code to be executed later. In a block, a proc/lambda, and a method.
September 20, 2021
A List of Middleware Used by Rails
Here’s a list of middleware Rails uses in a development environment. You can view the middleware by running the bin/rails middleware command from your application directory.
September 15, 2021